summaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
Diffstat (limited to 'classes')
-rw-r--r--classes/User.php14
-rw-r--r--classes/User_role.php2
2 files changed, 16 insertions, 0 deletions
diff --git a/classes/User.php b/classes/User.php
index 9f1ee53f4..0e8404377 100644
--- a/classes/User.php
+++ b/classes/User.php
@@ -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);
+ }
}
diff --git a/classes/User_role.php b/classes/User_role.php
index fc3806897..b415642fc 100644
--- a/classes/User_role.php
+++ b/classes/User_role.php
@@ -48,4 +48,6 @@ class User_role extends Memcached_DataObject
const MODERATOR = 'moderator';
const ADMINISTRATOR = 'administrator';
+ const SANDBOXED = 'sandboxed';
+ const SILENCED = 'silenced';
}