wip: org to community

This commit is contained in:
2021-08-27 11:42:01 +03:00
parent 85f697addd
commit 9721bd41d5
4 changed files with 11 additions and 16 deletions

View File

@@ -1,4 +1,4 @@
from orm.rbac import Organization, Operation, Resource, Permission, Role
from orm.rbac import Community, Operation, Resource, Permission, Role
from orm.user import User
from orm.message import Message
from orm.topic import Topic

View File

@@ -11,7 +11,7 @@ class Community(Base):
slug: str = Column(String, unique = True, nullable = False)
desc: str = Column(String, nullable=False, default='')
pic: str = Column(String, nullable=False, default='')
org_id: str = Column(ForeignKey("organization.id"), nullable=True)
# org_id: str = Column(ForeignKey("organization.id"), nullable=True)
createdAt: str = Column(DateTime, nullable=False, default = datetime.now, comment="Created at")
createdBy: str = Column(ForeignKey("user.id"), nullable=False, comment="Creator")

View File

@@ -33,7 +33,7 @@ class Role(Base):
# id is auto field
name: str = Column(String, nullable=False, comment="Role Name")
desc: str = Colulm(String, nullable=True, comment="Role Description")
desc: str = Column(String, nullable=True, comment="Role Description")
community: int = Column(ForeignKey("community.id", ondelete="CASCADE"), nullable=False, comment="Community")
permissions = relationship(lambda: Permission)