]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
define rights around how to silence, sandbox, and delete a user
authorEvan Prodromou <evan@status.net>
Sun, 15 Nov 2009 14:59:10 +0000 (15:59 +0100)
committerEvan Prodromou <evan@status.net>
Sun, 15 Nov 2009 14:59:10 +0000 (15:59 +0100)
classes/User.php
classes/User_role.php
lib/right.php

index 9f1ee53f48c8e3e0db868b219527d5b469b2d972..0e84043771b6fd665eff6ad6bc343d98b174079d 100644 (file)
@@ -720,10 +720,14 @@ class User extends Memcached_DataObject
             switch ($right)
             {
             case Right::DELETEOTHERSNOTICE:
+            case Right::SANDBOXUSER:
+            case Right::SILENCEUSER:
+            case Right::DELETEUSER:
                 $result = $this->hasRole(User_role::MODERATOR);
                 break;
             case Right::CONFIGURESITE:
                 $result = $this->hasRole(User_role::ADMINISTRATOR);
+                break;
             default:
                 $result = false;
                 break;
@@ -774,4 +778,14 @@ class User extends Memcached_DataObject
         $block->delete();
         // XXX delete group block? Reset blocker?
     }
+
+    function isSandboxed()
+    {
+        return $this->hasRole(User_role::SANDBOXED);
+    }
+
+    function isSilenced()
+    {
+        return $this->hasRole(User_role::SILENCED);
+    }
 }
index fc3806897f42912c8c58ad182aac17ec546b76fb..b415642fc26c724a7b1fbe1f5d1a37073276f824 100644 (file)
@@ -48,4 +48,6 @@ class User_role extends Memcached_DataObject
 
     const MODERATOR     = 'moderator';
     const ADMINISTRATOR = 'administrator';
+    const SANDBOXED     = 'sandboxed';
+    const SILENCED      = 'silenced';
 }
index 4fc981af047c10d55deb6175a4a1b7c985e44607..88abdf78055ac04ce2caf21808e5871bd5ec870c 100644 (file)
@@ -47,5 +47,8 @@ class Right
 {
     const DELETEOTHERSNOTICE = 'deleteothersnotice';
     const CONFIGURESITE      = 'configuresite';
+    const DELETEUSER         = 'deleteuser';
+    const SILENCEUSER        = 'silenceuser';
+    const SANDBOXUSER        = 'sandboxuser';
 }