mirror of
https://github.com/zulip/zulip.git
synced 2025-11-09 08:26:11 +00:00
management: Include moderator option in change_user_role command.
We now allow to change a user role to moderator and to change role from moderator to any other role using change_user_role command.
This commit is contained in:
@@ -23,7 +23,15 @@ ONLY perform this on customer request from an authorized person.
|
|||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"new_role",
|
"new_role",
|
||||||
metavar="<new_role>",
|
metavar="<new_role>",
|
||||||
choices=["owner", "admin", "member", "guest", "can_forge_sender", "can_create_users"],
|
choices=[
|
||||||
|
"owner",
|
||||||
|
"admin",
|
||||||
|
"moderator",
|
||||||
|
"member",
|
||||||
|
"guest",
|
||||||
|
"can_forge_sender",
|
||||||
|
"can_create_users",
|
||||||
|
],
|
||||||
help="new role of the user",
|
help="new role of the user",
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
@@ -43,6 +51,7 @@ ONLY perform this on customer request from an authorized person.
|
|||||||
user_role_map = {
|
user_role_map = {
|
||||||
"owner": UserProfile.ROLE_REALM_OWNER,
|
"owner": UserProfile.ROLE_REALM_OWNER,
|
||||||
"admin": UserProfile.ROLE_REALM_ADMINISTRATOR,
|
"admin": UserProfile.ROLE_REALM_ADMINISTRATOR,
|
||||||
|
"moderator": UserProfile.ROLE_MODERATOR,
|
||||||
"member": UserProfile.ROLE_MEMBER,
|
"member": UserProfile.ROLE_MEMBER,
|
||||||
"guest": UserProfile.ROLE_GUEST,
|
"guest": UserProfile.ROLE_GUEST,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1406,6 +1406,7 @@ class UserProfile(AbstractBaseUser, PermissionsMixin):
|
|||||||
ROLE_ID_TO_NAME_MAP = {
|
ROLE_ID_TO_NAME_MAP = {
|
||||||
ROLE_REALM_OWNER: gettext_lazy("Organization owner"),
|
ROLE_REALM_OWNER: gettext_lazy("Organization owner"),
|
||||||
ROLE_REALM_ADMINISTRATOR: gettext_lazy("Organization administrator"),
|
ROLE_REALM_ADMINISTRATOR: gettext_lazy("Organization administrator"),
|
||||||
|
ROLE_MODERATOR: gettext_lazy("Moderator"),
|
||||||
ROLE_MEMBER: gettext_lazy("Member"),
|
ROLE_MEMBER: gettext_lazy("Member"),
|
||||||
ROLE_GUEST: gettext_lazy("Guest"),
|
ROLE_GUEST: gettext_lazy("Guest"),
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user