Skip to content
Snippets Groups Projects
Verified Commit b77f95f2 authored by nd's avatar nd
Browse files

Merge branch 'master' of git.cccv.de:infra/uffd/uffd

parents f47756f4 dba6d2b2
No related branches found
No related tags found
No related merge requests found
...@@ -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',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment