diff options
| author | Andy Staudacher <andy.st@gmail.com> | 2009-11-15 19:44:47 -0800 |
|---|---|---|
| committer | Andy Staudacher <andy.st@gmail.com> | 2009-11-15 19:44:47 -0800 |
| commit | 0733dc37fda27a5ba35f9020edf3c66aa41a95a0 (patch) | |
| tree | 6877946232f1b01b1c8709054c689f6658cef34f /modules/gallery/helpers/access.php | |
| parent | 218493c50be9362d4abed6900a816308fee5d978 (diff) | |
| parent | 9379308f91a476f790fb8d444536719535c584e4 (diff) | |
Merge commit 'upstream/master'
Conflicts:
modules/gallery/tests/xss_data.txt
Diffstat (limited to 'modules/gallery/helpers/access.php')
| -rw-r--r-- | modules/gallery/helpers/access.php | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/modules/gallery/helpers/access.php b/modules/gallery/helpers/access.php index 949aea84..c1c1f9d1 100644 --- a/modules/gallery/helpers/access.php +++ b/modules/gallery/helpers/access.php @@ -79,7 +79,7 @@ class access_Core { * @return boolean */ static function can($perm_name, $item) { - return self::user_can(user::active(), $perm_name, $item); + return self::user_can(identity::active_user(), $perm_name, $item); } /** @@ -197,8 +197,8 @@ class access_Core { * @param Item_Model $item * @param boolean $value */ - private static function _set(Group_Model $group, $perm_name, $album, $value) { - if (get_class($group) != "Group_Model") { + private static function _set(Group_Definition $group, $perm_name, $album, $value) { + if (!($group instanceof Group_Definition)) { throw new Exception("@todo PERMISSIONS_ONLY_WORK_ON_GROUPS"); } if (!$album->loaded) { @@ -419,10 +419,10 @@ class access_Core { * @return ORM_Iterator */ private static function _get_all_groups() { - // When we build the gallery package, it's possible that the user module is not installed yet. + // When we build the gallery package, it's possible that there is no identity provider installed yet. // This is ok at packaging time, so work around it. - if (module::is_active("user")) { - return ORM::factory("group")->find_all(); + if (module::is_active(module::get_var("gallery", "identity_provider", "user"))) { + return identity::groups(); } else { return array(); } |
