summaryrefslogtreecommitdiff
path: root/modules/gallery/controllers/permissions.php
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-09-06 11:45:41 -0700
committerBharat Mediratta <bharat@menalto.com>2009-09-06 11:45:41 -0700
commit14ba8505cccd361a4618c4b26868240a0b2fb226 (patch)
treed6380fe1a0cfdff2f378a81346d47db54d00df6a /modules/gallery/controllers/permissions.php
parent6c6031052257bdccf82ce2b598b42d743f455728 (diff)
Don't allow users to take away their own edit permissions. If we
detect that they did, just give it back. There's no visible message in that case.
Diffstat (limited to 'modules/gallery/controllers/permissions.php')
-rw-r--r--modules/gallery/controllers/permissions.php7
1 files changed, 7 insertions, 0 deletions
diff --git a/modules/gallery/controllers/permissions.php b/modules/gallery/controllers/permissions.php
index c776a0fd..5f4620b2 100644
--- a/modules/gallery/controllers/permissions.php
+++ b/modules/gallery/controllers/permissions.php
@@ -71,6 +71,13 @@ class Permissions_Controller extends Controller {
access::reset($group, $perm->name, $item);
break;
}
+
+ // If the active user just took away their own edit permissions, give it back.
+ if ($perm->name == "edit") {
+ if (!access::user_can(user::active(), "edit", $item)) {
+ access::allow($group, $perm->name, $item);
+ }
+ }
}
}