Beispiel #1
0
 def create_one(self,
                user: User,
                workspace: Workspace,
                role_level: int,
                with_notif: bool,
                flush: bool = True) -> UserRoleInWorkspace:
     role = UserRoleInWorkspace()
     role.user_id = user.user_id
     role.workspace = workspace
     role.role = role_level
     role.do_notify = with_notif
     if flush:
         self._session.flush()
     return role
Beispiel #2
0
    def create_role(cls) -> UserRoleInWorkspace:
        role = UserRoleInWorkspace()

        return role