|
@@ -5,16 +5,13 @@ from misago.forms import YesNoSwitch
|
|
|
|
|
|
def make_form(request, role, form):
|
|
def make_form(request, role, form):
|
|
if not role.special and request.user.is_god():
|
|
if not role.special and request.user.is_god():
|
|
- form.base_fields['can_use_mcp'] = forms.BooleanField(label=_("Can use Moderator Control Panel"),
|
|
|
|
- help_text=_("Change this permission to yes to grant access to Mod CP for users with this role."),
|
|
|
|
- widget=YesNoSwitch, initial=False, required=False)
|
|
|
|
form.base_fields['can_use_acp'] = forms.BooleanField(label=_("Can use Admin Control Panel"),
|
|
form.base_fields['can_use_acp'] = forms.BooleanField(label=_("Can use Admin Control Panel"),
|
|
help_text=_("Change this permission to yes to grant admin access for users with this role."),
|
|
help_text=_("Change this permission to yes to grant admin access for users with this role."),
|
|
widget=YesNoSwitch, initial=False, required=False)
|
|
widget=YesNoSwitch, initial=False, required=False)
|
|
|
|
|
|
form.fieldsets.append((
|
|
form.fieldsets.append((
|
|
- _("Special Access"),
|
|
|
|
- ('can_use_mcp', 'can_use_acp')
|
|
|
|
|
|
+ _("Admin Control Panel"),
|
|
|
|
+ ('can_use_acp',)
|
|
))
|
|
))
|
|
|
|
|
|
|
|
|
|
@@ -22,23 +19,17 @@ class SpecialACL(BaseACL):
|
|
def is_admin(self):
|
|
def is_admin(self):
|
|
return self.acl['can_use_acp']
|
|
return self.acl['can_use_acp']
|
|
|
|
|
|
- def can_use_mcp(self):
|
|
|
|
- return self.acl['can_use_mcp']
|
|
|
|
-
|
|
|
|
|
|
|
|
def build(acl, roles):
|
|
def build(acl, roles):
|
|
- acl.special = SpecialACL()
|
|
|
|
- acl.special.acl['can_use_acp'] = False
|
|
|
|
- acl.special.acl['can_use_mcp'] = False
|
|
|
|
|
|
+ acl.acp = SpecialACL()
|
|
|
|
+ acl.acp.acl['can_use_acp'] = False
|
|
|
|
|
|
for role in roles:
|
|
for role in roles:
|
|
try:
|
|
try:
|
|
if role['can_use_acp']:
|
|
if role['can_use_acp']:
|
|
- acl.special.acl['can_use_acp'] = True
|
|
|
|
- if 'can_use_mcp' in role and role['can_use_mcp']:
|
|
|
|
- acl.special.acl['can_use_mcp'] = True
|
|
|
|
|
|
+ acl.acp.acl['can_use_acp'] = True
|
|
except KeyError:
|
|
except KeyError:
|
|
pass
|
|
pass
|
|
|
|
|
|
- if acl.special.acl['can_use_acp'] or acl.special.acl['can_use_mcp']:
|
|
|
|
|
|
+ if acl.acp.acl['can_use_acp']:
|
|
acl.team = True
|
|
acl.team = True
|