Commit f1c821aa authored by ibuler's avatar ibuler

[Update] 审计员

parent 3e86c074
This diff is collapsed.
...@@ -62,6 +62,7 @@ class UserCreateUpdateFormMixin(OrgModelForm): ...@@ -62,6 +62,7 @@ class UserCreateUpdateFormMixin(OrgModelForm):
if self.request.user.is_superuser: if self.request.user.is_superuser:
roles.append((User.ROLE_ADMIN, dict(User.ROLE_CHOICES).get(User.ROLE_ADMIN))) roles.append((User.ROLE_ADMIN, dict(User.ROLE_CHOICES).get(User.ROLE_ADMIN)))
roles.append((User.ROLE_USER, dict(User.ROLE_CHOICES).get(User.ROLE_USER))) roles.append((User.ROLE_USER, dict(User.ROLE_CHOICES).get(User.ROLE_USER)))
roles.append((User.ROLE_AUDITOR, dict(User.ROLE_CHOICES).get(User.ROLE_AUDITOR)))
# Org admin user # Org admin user
else: else:
......
# Generated by Django 2.1.7 on 2019-06-12 10:25
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0019_auto_20190304_1459'),
]
operations = [
migrations.AlterField(
model_name='user',
name='role',
field=models.CharField(blank=True, choices=[('Admin', 'Administrator'), ('User', 'User'), ('App', 'Application'), ('Auditor', 'Auditor')], default='User', max_length=10, verbose_name='Role'),
),
]
...@@ -30,11 +30,13 @@ class User(AbstractUser): ...@@ -30,11 +30,13 @@ class User(AbstractUser):
ROLE_ADMIN = 'Admin' ROLE_ADMIN = 'Admin'
ROLE_USER = 'User' ROLE_USER = 'User'
ROLE_APP = 'App' ROLE_APP = 'App'
ROLE_AUDITOR = 'Auditor'
ROLE_CHOICES = ( ROLE_CHOICES = (
(ROLE_ADMIN, _('Administrator')), (ROLE_ADMIN, _('Administrator')),
(ROLE_USER, _('User')), (ROLE_USER, _('User')),
(ROLE_APP, _('Application')) (ROLE_APP, _('Application')),
(ROLE_AUDITOR, _("Auditor"))
) )
OTP_LEVEL_CHOICES = ( OTP_LEVEL_CHOICES = (
(0, _('Disable')), (0, _('Disable')),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment