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
cc56c925
Commit
cc56c925
authored
Jul 06, 2019
by
ibuler
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of github.com:jumpserver/jumpserver into dev
parents
447c3f31
eba8e542
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
6 deletions
+14
-6
asset.py
apps/assets/models/asset.py
+1
-1
asset_permission.py
apps/perms/models/asset_permission.py
+13
-5
No files found.
apps/assets/models/asset.py
View file @
cc56c925
...
...
@@ -15,7 +15,7 @@ from .user import AdminUser, SystemUser
from
.utils
import
Connectivity
from
orgs.mixins
import
OrgModelMixin
,
OrgManager
__all__
=
[
'Asset'
]
__all__
=
[
'Asset'
,
'ProtocolsMixin'
]
logger
=
logging
.
getLogger
(
__name__
)
...
...
apps/perms/models/asset_permission.py
View file @
cc56c925
...
...
@@ -16,6 +16,7 @@ __all__ = [
class
Action
:
NONE
=
0
CONNECT
=
0
b00000001
UPLOAD
=
0
b00000010
DOWNLOAD
=
0
b00000100
...
...
@@ -51,13 +52,20 @@ class Action:
@classmethod
def
choices_to_value
(
cls
,
value
):
if
not
isinstance
(
value
,
list
):
return
cls
.
NONE
db_value
=
[
cls
.
NAME_MAP_REVERSE
[
v
]
for
v
in
value
if
v
in
cls
.
NAME_MAP_REVERSE
.
keys
()
]
if
not
db_value
:
return
cls
.
NONE
def
to_choices
(
x
,
y
):
x
=
cls
.
NAME_MAP_REVERSE
.
get
(
x
,
0
)
y
=
cls
.
NAME_MAP_REVERSE
.
get
(
y
,
0
)
return
x
|
y
if
not
value
:
return
None
return
re
duce
(
to_choices
,
value
)
result
=
reduce
(
to_choices
,
db_value
)
return
re
sult
@classmethod
def
choices
(
cls
):
...
...
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