let hooks override standard user rights
This commit is contained in:
parent
6c069312e2
commit
38345d0783
|
@ -726,15 +726,18 @@ class User extends Memcached_DataObject
|
||||||
|
|
||||||
function hasRight($right)
|
function hasRight($right)
|
||||||
{
|
{
|
||||||
|
$result = false;
|
||||||
|
if (Event::handle('UserRightsCheck', array($this, $right, &$result))) {
|
||||||
switch ($right)
|
switch ($right)
|
||||||
{
|
{
|
||||||
case Right::deleteOthersNotice:
|
case Right::deleteOthersNotice:
|
||||||
return $this->hasRole('moderator');
|
$result = $this->hasRole('moderator');
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$result = false;
|
$result = false;
|
||||||
Event::handle('UserRightsCheck', array($this, &$result));
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user