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))) { if (Event::handle('UserRightsCheck', array($this, $right, &$result))) {
switch ($right) switch ($right)
{ {
case Right::deleteOthersNotice: case Right::DELETEOTHERSNOTICE:
$result = $this->hasRole('moderator'); $result = $this->hasRole(User_role::MODERATOR);
break; break;
default: case Right::CONFIGURESITE:
$result = $this->hasRole(User_role::ADMINISTRATOR);
default:
$result = false; $result = false;
break; break;
} }