From c9475c76a8b4c2bf32d1d3293b03b646e7e7a91e Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Sun, 15 Nov 2009 15:59:10 +0100 Subject: [PATCH] define rights around how to silence, sandbox, and delete a user --- classes/User.php | 14 ++++++++++++++ classes/User_role.php | 2 ++ lib/right.php | 3 +++ 3 files changed, 19 insertions(+) diff --git a/classes/User.php b/classes/User.php index 9f1ee53f48..0e84043771 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 fc3806897f..b415642fc2 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'; } diff --git a/lib/right.php b/lib/right.php index 4fc981af04..88abdf7805 100644 --- a/lib/right.php +++ b/lib/right.php @@ -47,5 +47,8 @@ class Right { const DELETEOTHERSNOTICE = 'deleteothersnotice'; const CONFIGURESITE = 'configuresite'; + const DELETEUSER = 'deleteuser'; + const SILENCEUSER = 'silenceuser'; + const SANDBOXUSER = 'sandboxuser'; } -- 2.39.5