Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
J
jumpserver
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ops
jumpserver
Commits
f1c821aa
Commit
f1c821aa
authored
Jun 12, 2019
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Update] 审计员
parent
3e86c074
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
22 additions
and
1 deletion
+22
-1
django.mo
apps/locale/zh/LC_MESSAGES/django.mo
+0
-0
django.po
apps/locale/zh/LC_MESSAGES/django.po
+0
-0
forms.py
apps/users/forms.py
+1
-0
0020_auto_20190612_1825.py
apps/users/migrations/0020_auto_20190612_1825.py
+18
-0
user.py
apps/users/models/user.py
+3
-1
No files found.
apps/locale/zh/LC_MESSAGES/django.mo
View file @
f1c821aa
No preview for this file type
apps/locale/zh/LC_MESSAGES/django.po
View file @
f1c821aa
This diff is collapsed.
Click to expand it.
apps/users/forms.py
View file @
f1c821aa
...
@@ -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
:
...
...
apps/users/migrations/0020_auto_20190612_1825.py
0 → 100644
View file @
f1c821aa
# 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'
),
),
]
apps/users/models/user.py
View file @
f1c821aa
...
@@ -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'
)),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment