diff options
Diffstat (limited to 'modules/gallery')
| -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 63324e5d..224b51e0 100644 --- a/modules/gallery/helpers/access.php +++ b/modules/gallery/helpers/access.php @@ -78,11 +78,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;      } | 
