forked from GNUsocial/gnu-social
Moderator can make users admins of a group
This commit is contained in:
parent
823939ca84
commit
5fdcd88176
@ -192,7 +192,9 @@ class GroupMemberListItem extends ProfileListItem
|
|||||||
{
|
{
|
||||||
$user = common_current_user();
|
$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->profile->isAdmin($this->group)) {
|
||||||
$this->out->elementStart('li', 'entity_make_admin');
|
$this->out->elementStart('li', 'entity_make_admin');
|
||||||
$maf = new MakeAdminForm($this->out, $this->profile, $this->group,
|
$maf = new MakeAdminForm($this->out, $this->profile, $this->group,
|
||||||
|
@ -87,7 +87,8 @@ class MakeadminAction extends Action
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$user = common_current_user();
|
$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);
|
$this->clientError(_('Only an admin can make another user an admin.'), 401);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -716,6 +716,7 @@ class Profile extends Memcached_DataObject
|
|||||||
switch ($right)
|
switch ($right)
|
||||||
{
|
{
|
||||||
case Right::DELETEOTHERSNOTICE:
|
case Right::DELETEOTHERSNOTICE:
|
||||||
|
case Right::MAKEGROUPADMIN:
|
||||||
case Right::SANDBOXUSER:
|
case Right::SANDBOXUSER:
|
||||||
case Right::SILENCEUSER:
|
case Right::SILENCEUSER:
|
||||||
case Right::DELETEUSER:
|
case Right::DELETEUSER:
|
||||||
|
@ -57,5 +57,6 @@ class Right
|
|||||||
const EMAILONREPLY = 'emailonreply';
|
const EMAILONREPLY = 'emailonreply';
|
||||||
const EMAILONSUBSCRIBE = 'emailonsubscribe';
|
const EMAILONSUBSCRIBE = 'emailonsubscribe';
|
||||||
const EMAILONFAVE = 'emailonfave';
|
const EMAILONFAVE = 'emailonfave';
|
||||||
|
const MAKEGROUPADMIN = 'makegroupadmin';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user