diff options
author | Evan Prodromou <evan@status.net> | 2009-11-19 09:04:56 -0500 |
---|---|---|
committer | Evan Prodromou <evan@status.net> | 2009-11-19 09:04:56 -0500 |
commit | b657e49ec772aec2b60ae193252edd53d85e1df5 (patch) | |
tree | 71f6054ac22b8355f434fd9bf4c2ccfc1afc5140 /classes/Profile.php | |
parent | fa35dab2265aba78f7c704c34eaef4100bddfd70 (diff) | |
parent | 269781280903d80141788225ec858fbf6501971d (diff) |
Merge branch '0.9.x' into mapstraction
Diffstat (limited to 'classes/Profile.php')
-rw-r--r-- | classes/Profile.php | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/classes/Profile.php b/classes/Profile.php index 1b9cdb52f..4b2e09006 100644 --- a/classes/Profile.php +++ b/classes/Profile.php @@ -594,9 +594,14 @@ class Profile extends Memcached_DataObject function hasRole($name) { - $role = Profile_role::pkeyGet(array('profile_id' => $this->id, - 'role' => $name)); - return (!empty($role)); + $has_role = false; + if (Event::handle('StartHasRole', array($this, $name, &$has_role))) { + $role = Profile_role::pkeyGet(array('profile_id' => $this->id, + 'role' => $name)); + $has_role = !empty($role); + Event::handle('EndHasRole', array($this, $name, $has_role)); + } + return $has_role; } function grantRole($name) |