use upper-case constants for roles and rights in hasRight()

This commit is contained in:
Evan Prodromou 2009-11-07 19:16:54 -05:00
parent eaec5b03f5
commit 38833af6f1

View File

@ -705,10 +705,12 @@ class User extends Memcached_DataObject
if (Event::handle('UserRightsCheck', array($this, $right, &$result))) {
switch ($right)
{
case Right::deleteOthersNotice:
$result = $this->hasRole('moderator');
case Right::DELETEOTHERSNOTICE:
$result = $this->hasRole(User_role::MODERATOR);
break;
default:
case Right::CONFIGURESITE:
$result = $this->hasRole(User_role::ADMINISTRATOR);
default:
$result = false;
break;
}