]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Moderator can make users admins of a group
authorEvan Prodromou <evan@status.net>
Sat, 6 Feb 2010 10:36:59 +0000 (11:36 +0100)
committerEvan Prodromou <evan@status.net>
Sat, 6 Feb 2010 10:36:59 +0000 (11:36 +0100)
actions/groupmembers.php
actions/makeadmin.php
classes/Profile.php
lib/right.php

index 0f47c268dd30eda6bd4094bc7acbca56c3259031..f16e972a4194a6eee1a0fd60e2c4fad70881b36d 100644 (file)
@@ -192,7 +192,9 @@ class GroupMemberListItem extends ProfileListItem
     {
         $user = common_current_user();
 
-        if (!empty($user) && $user->id != $this->profile->id && $user->isAdmin($this->group) &&
+        if (!empty($user) &&
+            $user->id != $this->profile->id &&
+            ($user->isAdmin($this->group) || $user->hasRight(Right::MAKEGROUPADMIN)) &&
             !$this->profile->isAdmin($this->group)) {
             $this->out->elementStart('li', 'entity_make_admin');
             $maf = new MakeAdminForm($this->out, $this->profile, $this->group,
index 9ad7d6e7c821a247cdc1961e1cbed593dc785991..f19348648d8700f50b0ef8955419dbd7a0b24ecf 100644 (file)
@@ -87,7 +87,8 @@ class MakeadminAction extends Action
             return false;
         }
         $user = common_current_user();
-        if (!$user->isAdmin($this->group)) {
+        if (!$user->isAdmin($this->group) &&
+            !$user->hasRight(Right::MAKEGROUPADMIN)) {
             $this->clientError(_('Only an admin can make another user an admin.'), 401);
             return false;
         }
index 1076fb2cb3e09f8b95b1915b36f1b6bb5ffbcef6..feabc250870c2effcff82b065b3b65eb021c8764 100644 (file)
@@ -716,6 +716,7 @@ class Profile extends Memcached_DataObject
             switch ($right)
             {
             case Right::DELETEOTHERSNOTICE:
+            case Right::MAKEGROUPADMIN:
             case Right::SANDBOXUSER:
             case Right::SILENCEUSER:
             case Right::DELETEUSER:
index 5e66eae0ed3da13e43d638eb6e33f9534ebb9043..4e9c5a918dbe02b2e2795c63167dd9a99d7db8e7 100644 (file)
@@ -57,5 +57,6 @@ class Right
     const EMAILONREPLY       = 'emailonreply';
     const EMAILONSUBSCRIBE   = 'emailonsubscribe';
     const EMAILONFAVE        = 'emailonfave';
+    const MAKEGROUPADMIN     = 'makegroupadmin';
 }