diff options
| author | Romain LE DISEZ <romain.git@ledisez.net> | 2009-07-22 08:38:06 +0200 |
|---|---|---|
| committer | Romain LE DISEZ <romain.git@ledisez.net> | 2009-07-22 08:38:06 +0200 |
| commit | 317b7b98c094386407251c2baf8f6e7c391c7bff (patch) | |
| tree | 98898d791df3a10cf6f9c1c62fbce06d8c9a7de1 /modules/gallery/helpers/access.php | |
| parent | 00b3ca82de3a4858745988943a46d07b1c0fd006 (diff) | |
| parent | f533aee1cc71e8db739406859ac0cf43dce030ec (diff) | |
Merge commit 'upstream/master'
Diffstat (limited to 'modules/gallery/helpers/access.php')
| -rw-r--r-- | modules/gallery/helpers/access.php | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/modules/gallery/helpers/access.php b/modules/gallery/helpers/access.php index 44ad057c..34eb709e 100644 --- a/modules/gallery/helpers/access.php +++ b/modules/gallery/helpers/access.php @@ -79,11 +79,23 @@ class access_Core { * @return boolean */ static function can($perm_name, $item) { + return self::user_can(user::active(), $perm_name, $item); + } + + /** + * Does the user have this permission on this item? + * + * @param User_Model $user + * @param string $perm_name + * @param Item_Model $item + * @return boolean + */ + static function user_can($user, $perm_name, $item) { if (!$item->loaded) { return false; } - if (user::active()->admin) { + if ($user->admin) { return true; } |
