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
d9812e2b
Commit
d9812e2b
authored
Sep 16, 2016
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove action from asset permission
parent
74b8ee8c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
1 addition
and
13 deletions
+1
-13
forms.py
apps/perms/forms.py
+1
-1
models.py
apps/perms/models.py
+0
-6
asset_permission_create_update.html
...perms/templates/perms/asset_permission_create_update.html
+0
-2
asset_permission_detail.html
apps/perms/templates/perms/asset_permission_detail.html
+0
-4
No files found.
apps/perms/forms.py
View file @
d9812e2b
...
...
@@ -14,7 +14,7 @@ class AssetPermissionForm(forms.ModelForm):
model
=
AssetPermission
fields
=
[
'name'
,
'users'
,
'user_groups'
,
'assets'
,
'asset_groups'
,
'system_users'
,
'
action'
,
'
is_active'
,
'date_expired'
,
'comment'
,
'system_users'
,
'is_active'
,
'date_expired'
,
'comment'
,
]
widgets
=
{
'users'
:
forms
.
SelectMultiple
(
attrs
=
{
'class'
:
'select2'
,
...
...
apps/perms/models.py
View file @
d9812e2b
...
...
@@ -11,18 +11,12 @@ from common.utils import date_expired_default, combine_seq
class
AssetPermission
(
models
.
Model
):
ACTION_CHOICE
=
(
(
'1'
,
'Allow'
),
(
'0'
,
'Deny'
),
)
name
=
models
.
CharField
(
max_length
=
128
,
verbose_name
=
_
(
'Name'
))
users
=
models
.
ManyToManyField
(
User
,
related_name
=
'asset_permissions'
,
blank
=
True
)
user_groups
=
models
.
ManyToManyField
(
UserGroup
,
related_name
=
'asset_permissions'
,
blank
=
True
)
assets
=
models
.
ManyToManyField
(
Asset
,
related_name
=
'granted_by_permissions'
,
blank
=
True
)
asset_groups
=
models
.
ManyToManyField
(
AssetGroup
,
related_name
=
'granted_by_permissions'
,
blank
=
True
)
system_users
=
models
.
ManyToManyField
(
SystemUser
,
related_name
=
'granted_by_permissions'
)
action
=
models
.
CharField
(
choices
=
ACTION_CHOICE
,
max_length
=
8
,
default
=
'1'
)
is_active
=
models
.
BooleanField
(
default
=
True
,
verbose_name
=
_
(
'Active'
))
date_expired
=
models
.
DateTimeField
(
default
=
date_expired_default
,
verbose_name
=
_
(
'Date expired'
))
created_by
=
models
.
CharField
(
max_length
=
128
,
blank
=
True
,
verbose_name
=
_
(
'Created by'
))
...
...
apps/perms/templates/perms/asset_permission_create_update.html
View file @
d9812e2b
...
...
@@ -43,8 +43,6 @@
{{ form.system_users |bootstrap_horizontal }}
<div
class=
"hr-line-dashed"
></div>
<h3>
{% trans 'Other' %}
</h3>
{{ form.action|bootstrap_horizontal }}
<div
class=
"form-group"
>
<label
for=
"{{ form.is_active.id_for_label }}"
class=
"col-sm-2 control-label"
>
{% trans 'Active' %}
</label>
<div
class=
"col-sm-8"
>
...
...
apps/perms/templates/perms/asset_permission_detail.html
View file @
d9812e2b
...
...
@@ -80,10 +80,6 @@
<td>
{% trans 'Action' %}:
</td>
<td><b>
{{ asset_permission.get_action_display }}
</b></td>
</tr>
<tr>
<td>
{% trans 'Is active' %}:
</td>
<td><b>
{{ asset_permission.is_active|yesno:'Yes, No, Unkown' }}
</b></td>
</tr>
<tr>
<td>
{% trans 'Date expired' %}:
</td>
<td><b>
{{ asset_permission.date_expired }}
</b></td>
...
...
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