From 14ba8505cccd361a4618c4b26868240a0b2fb226 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sun, 6 Sep 2009 11:45:41 -0700 Subject: 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. --- modules/gallery/controllers/permissions.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'modules/gallery/controllers/permissions.php') 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); + } + } } } -- cgit v1.2.3