summaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
Diffstat (limited to 'classes')
-rw-r--r--classes/Profile.php11
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)