Fix circular import

This commit is contained in:
Tiago Garcia 2024-12-17 15:32:39 +00:00
parent 73c2b23eb9
commit fab60873c8
Signed by: TiagoRG
GPG Key ID: DFCD48E3F420DB42
1 changed files with 1 additions and 1 deletions

View File

@ -4,7 +4,6 @@ from database import db
from models import Organization, User, File from models import Organization, User, File
from sqlalchemy.orm.attributes import flag_modified from sqlalchemy.orm.attributes import flag_modified
from services import FileService, OrganizationService
from utils import Perm, PermOperation from utils import Perm, PermOperation
@ -101,6 +100,7 @@ class RoleService:
@staticmethod @staticmethod
def get_perms_for_role(org: Organization, role: str, return_str=False) -> list[Perm | str]: def get_perms_for_role(org: Organization, role: str, return_str=False) -> list[Perm | str]:
from services import FileService
perms_list = Perm.get_perms(org.roles[role]["permissions"], return_str) perms_list = Perm.get_perms(org.roles[role]["permissions"], return_str)
for f in FileService.list_files_in_org(org): for f in FileService.list_files_in_org(org):
perms_list.append({f.document_handle: Perm.get_perms(f.acl[role], return_str)}) perms_list.append({f.document_handle: Perm.get_perms(f.acl[role], return_str)})