auth and rbac improves

This commit is contained in:
2025-08-20 18:33:58 +03:00
parent fe76eef273
commit fb45178396
10 changed files with 426 additions and 225 deletions

View File

@@ -40,6 +40,18 @@ class RBACOperations(Protocol):
"""Проверяет, есть ли у набора ролей конкретное разрешение в сообществе"""
...
def assign_role_to_user(self, author_id: int, role: str, community_id: int, session: Any = None) -> bool:
"""Назначает роль пользователю в сообществе"""
...
def get_user_roles_in_community(self, author_id: int, community_id: int, session: Any = None) -> list[str]:
"""Получает роли пользователя в сообществе"""
...
def remove_role_from_user(self, author_id: int, role: str, community_id: int, session: Any = None) -> bool:
"""Удаляет роль у пользователя в сообществе"""
...
class CommunityAuthorQueries(Protocol):
"""