diff --git a/3.0/modules/user_chroot/helpers/MY_access.php b/3.0/modules/user_chroot/helpers/MY_access.php index 5f73b4ca..e1a854f8 100644 --- a/3.0/modules/user_chroot/helpers/MY_access.php +++ b/3.0/modules/user_chroot/helpers/MY_access.php @@ -21,22 +21,27 @@ class access extends access_Core { /** - * Does the active user have this permission on this item? - * - * @param string $perm_name - * @param Item_Model $item - * @return boolean + * If the user is chrooted, deny access outside of the chroot. + */ + static function user_can($user, $perm_name, $item) { + if( $user->id == identity::active_user()->id && user_chroot::album() ) { + if( $item->left_ptr < user_chroot::album()->left_ptr || user_chroot::album()->right_ptr < $item->right_ptr ) { + return false; + } + } + + return parent::user_can($user, $perm_name, $item); + } + + /** + * Copied from modules/gallery/helpers/access.php because of the usage of self:: */ static function can($perm_name, $item) { return self::user_can(identity::active_user(), $perm_name, $item); } /** - * If the active user does not have this permission, failed with an access::forbidden(). - * - * @param string $perm_name - * @param Item_Model $item - * @return boolean + * Copied from modules/gallery/helpers/access.php because of the usage of self:: */ static function required($perm_name, $item) { if (!self::can($perm_name, $item)) { @@ -48,14 +53,4 @@ class access extends access_Core { } } } - - static function user_can($user, $perm_name, $item) { - if( $user->id == identity::active_user()->id && user_chroot::album() ) { - if( $item->left_ptr < user_chroot::album()->left_ptr || user_chroot::album()->right_ptr < $item->right_ptr ) { - return false; - } - } - - return parent::user_can($user, $perm_name, $item); - } }