summaryrefslogtreecommitdiff
path: root/modules/gallery/helpers/gallery_event.php
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2010-09-13 22:23:09 -0700
committerBharat Mediratta <bharat@menalto.com>2010-09-13 22:23:09 -0700
commit1a0d76c43e3545771ae3e1c6ad6ba255beeae32d (patch)
tree497e8d45e86983d3fd4929147f9728aed93b5740 /modules/gallery/helpers/gallery_event.php
parent19750cb0d5499920bb7786aa4f890dec84fc5a1f (diff)
When moving a single item, just copy its permissions from its parent
album. This is totally legal since an items permissions must be the same as its parent's, and it's much faster for large installs where a complete recalculation can be very costly. Should fix #1360.
Diffstat (limited to 'modules/gallery/helpers/gallery_event.php')
-rw-r--r--modules/gallery/helpers/gallery_event.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/modules/gallery/helpers/gallery_event.php b/modules/gallery/helpers/gallery_event.php
index 78a9f5a9..b59bb9b9 100644
--- a/modules/gallery/helpers/gallery_event.php
+++ b/modules/gallery/helpers/gallery_event.php
@@ -157,7 +157,11 @@ class gallery_event_Core {
}
static function item_moved($item, $old_parent) {
- access::recalculate_permissions($item->parent());
+ if ($item->is_album()) {
+ access::recalculate_album_permissions($item->parent());
+ } else {
+ access::recalculate_photo_permissions($item);
+ }
// If the new parent doesn't have an album cover, make this it.
if (!$item->parent()->album_cover_item_id) {