초기 커밋

This commit is contained in:
2026-03-01 07:44:19 +09:00
commit 09359f30be
146 changed files with 6120 additions and 0 deletions

16
app/core/permissions.py Normal file
View File

@@ -0,0 +1,16 @@
from __future__ import annotations
from app.core.constants import Role
def is_admin(role: str) -> bool:
return role in Role.ADMIN_ROLES
def is_management(role: str) -> bool:
return role in Role.MANAGEMENT_ROLES
def can_manage_user(actor_role: str, target_role: str) -> bool:
hierarchy = {Role.SUPERADMIN: 4, Role.ADMIN: 3, Role.MANAGER: 2, Role.USER: 1, Role.DEVICE: 0}
return hierarchy.get(actor_role, 0) > hierarchy.get(target_role, 0)