]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
use upper-case constants for roles and rights in hasRight()
authorEvan Prodromou <evan@status.net>
Sun, 8 Nov 2009 00:16:54 +0000 (19:16 -0500)
committerEvan Prodromou <evan@status.net>
Sun, 8 Nov 2009 00:16:54 +0000 (19:16 -0500)
classes/User.php

index 96a64ccb29448cc4b898bc41aa5a4114b8cdf2c8..546406f71e566ffbaa32e27f9cfb8d7713c19027 100644 (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;
             }