forked from sr2/cloud-api
feat: iam rbac system
Endpoints and db architecture to support a role based IAM system.
This commit is contained in:
parent
7b3ee9d5fa
commit
23f2ce98d7
31 changed files with 634 additions and 317 deletions
|
|
@ -6,7 +6,7 @@ Models:
|
|||
billing_contact_id[fk], security_contact_id[fk], owner_contact_id[fk]
|
||||
- OrgUsers: org_id[fk][cpk], user_id[fk][cpk], is_admin
|
||||
"""
|
||||
from sqlalchemy import Column, Integer, String, Boolean, ForeignKey, JSON, false
|
||||
from sqlalchemy import Column, Integer, String, ForeignKey, JSON
|
||||
|
||||
from src.database import Base
|
||||
|
||||
|
|
@ -15,10 +15,12 @@ class Organisation(Base):
|
|||
__tablename__ = "organisation"
|
||||
|
||||
id = Column(Integer, primary_key=True)
|
||||
name = Column(String)
|
||||
name = Column(String, unique=True)
|
||||
status = Column(String, default="partial")
|
||||
intake_questionnaire = Column(JSON)
|
||||
|
||||
root_user_id = Column(Integer, ForeignKey("user.id"))
|
||||
|
||||
billing_contact_id = Column(Integer, ForeignKey("contact.id"))
|
||||
security_contact_id = Column(Integer, ForeignKey("contact.id"))
|
||||
owner_contact_id = Column(Integer, ForeignKey("contact.id"))
|
||||
|
|
@ -29,4 +31,3 @@ class OrgUsers(Base):
|
|||
|
||||
org_id = Column(Integer, ForeignKey("organisation.id", ondelete="CASCADE"), primary_key=True)
|
||||
user_id = Column(Integer, ForeignKey("user.id", ondelete="CASCADE"), primary_key=True)
|
||||
is_admin = Column(Boolean, nullable=False, server_default=false())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue