Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
U
uffd
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
rixx
uffd
Commits
b77f95f2
Verified
Commit
b77f95f2
authored
3 years ago
by
nd
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' of git.cccv.de:infra/uffd/uffd
parents
f47756f4
dba6d2b2
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
uffd/role/models.py
+17
-7
17 additions, 7 deletions
uffd/role/models.py
with
17 additions
and
7 deletions
uffd/role/models.py
+
17
−
7
View file @
b77f95f2
...
@@ -7,21 +7,31 @@ from ldapalchemy.dbutils import DBRelationship
...
@@ -7,21 +7,31 @@ from ldapalchemy.dbutils import DBRelationship
from
uffd.database
import
db
from
uffd.database
import
db
from
uffd.user.models
import
User
,
Group
from
uffd.user.models
import
User
,
Group
class
LdapMapping
:
class
RoleGroup
(
db
.
Model
):
id
=
Column
(
Integer
(),
primary_key
=
True
,
autoincrement
=
True
)
__tablename__
=
'
role-group
'
dn
=
Column
(
String
(
128
))
__table_args__
=
(
__table_args__
=
(
db
.
UniqueConstraint
(
'
dn
'
,
'
role_id
'
),
db
.
UniqueConstraint
(
'
dn
'
,
'
role_id
'
),
)
)
id
=
Column
(
Integer
(),
primary_key
=
True
,
autoincrement
=
True
)
dn
=
Column
(
String
(
128
))
@declared_attr
@declared_attr
def
role_id
(
self
):
def
role_id
(
self
):
return
Column
(
ForeignKey
(
'
role.id
'
))
return
Column
(
ForeignKey
(
'
role.id
'
))
class
RoleGroup
(
LdapMapping
,
db
.
Model
):
class
RoleUser
(
db
.
Model
):
__tablename__
=
'
role-group
'
class
RoleUser
(
LdapMapping
,
db
.
Model
):
__tablename__
=
'
role-user
'
__tablename__
=
'
role-user
'
__table_args__
=
(
db
.
UniqueConstraint
(
'
dn
'
,
'
role_id
'
),
)
id
=
Column
(
Integer
(),
primary_key
=
True
,
autoincrement
=
True
)
dn
=
Column
(
String
(
128
))
@declared_attr
def
role_id
(
self
):
return
Column
(
ForeignKey
(
'
role.id
'
))
# pylint: disable=E1101
# pylint: disable=E1101
role_inclusion
=
db
.
Table
(
'
role-inclusion
'
,
role_inclusion
=
db
.
Table
(
'
role-inclusion
'
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment