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
8235c4db
Commit
8235c4db
authored
Feb 27, 2019
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Update] stash it
parent
dda876be
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
+11
-0
models.py
apps/authorization/models.py
+11
-0
No files found.
apps/authorization/models.py
View file @
8235c4db
import
re
from
django.db
import
models
from
django.db
import
models
from
django.conf
import
settings
from
django.conf
import
settings
...
@@ -5,6 +7,10 @@ from common.fields import JsonListTextField
...
@@ -5,6 +7,10 @@ from common.fields import JsonListTextField
from
orgs.mixins
import
OrgModelMixin
from
orgs.mixins
import
OrgModelMixin
def
default_rule_to_patterns_handler
(
rule
):
url
=
'/api/{app}/{version}/{resource}/'
class
BaseRole
(
models
.
Model
):
class
BaseRole
(
models
.
Model
):
name
=
models
.
SlugField
(
max_length
=
128
,
unique
=
True
,
allow_unicode
=
True
)
name
=
models
.
SlugField
(
max_length
=
128
,
unique
=
True
,
allow_unicode
=
True
)
rules
=
models
.
ManyToManyField
(
'Rule'
)
rules
=
models
.
ManyToManyField
(
'Rule'
)
...
@@ -32,6 +38,11 @@ class Rule(models.Model):
...
@@ -32,6 +38,11 @@ class Rule(models.Model):
resources
=
JsonListTextField
()
resources
=
JsonListTextField
()
resources_ids
=
JsonListTextField
()
resources_ids
=
JsonListTextField
()
non_resource_urls
=
JsonListTextField
()
non_resource_urls
=
JsonListTextField
()
date_created
=
models
.
DateTimeField
(
auto_now_add
=
True
)
created_by
=
models
.
CharField
(
max_length
=
128
,
blank
=
True
,
default
=
''
)
def
to_patterns
(
self
):
pass
class
BaseRoleBinding
(
models
.
Model
):
class
BaseRoleBinding
(
models
.
Model
):
...
...
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