This commit introduces several new analysis documents, including Auto-Match Load Performance Analysis, Folder Picker Analysis, Monorepo Migration Summary, and various performance analysis documents. Additionally, the installation scripts are updated to reflect changes in backend service paths, ensuring proper integration with the new backend structure. These enhancements provide better documentation and streamline the setup process for users.
33 lines
790 B
Python
33 lines
790 B
Python
"""Shared role definitions for backend user management."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from enum import Enum
|
|
from typing import Final, Set
|
|
|
|
|
|
class UserRole(str, Enum):
|
|
"""Enumerated set of supported user roles."""
|
|
|
|
ADMIN = "admin"
|
|
MANAGER = "manager"
|
|
MODERATOR = "moderator"
|
|
REVIEWER = "reviewer"
|
|
EDITOR = "editor"
|
|
IMPORTER = "importer"
|
|
VIEWER = "viewer"
|
|
|
|
|
|
ROLE_VALUES: Final[Set[str]] = {role.value for role in UserRole}
|
|
ADMIN_ROLE_VALUES: Final[Set[str]] = {
|
|
UserRole.ADMIN.value,
|
|
}
|
|
DEFAULT_ADMIN_ROLE: Final[str] = UserRole.ADMIN.value
|
|
DEFAULT_USER_ROLE: Final[str] = UserRole.VIEWER.value
|
|
|
|
|
|
def is_admin_role(role: str) -> bool:
|
|
"""Return True when the provided role is considered an admin role."""
|
|
return role in ADMIN_ROLE_VALUES
|
|
|