Primo commit
This commit is contained in:
@@ -5,6 +5,7 @@ Common helpers used across the application
|
||||
import uuid
|
||||
import re
|
||||
from typing import TYPE_CHECKING
|
||||
from database.models import UserRole
|
||||
|
||||
from app import config
|
||||
|
||||
@@ -24,7 +25,7 @@ def is_ldap_user(user: "User") -> bool:
|
||||
|
||||
def is_ldap_admin(user: "User") -> bool:
|
||||
"""Check if user is an LDAP-managed admin"""
|
||||
return is_ldap_user(user) and user.role == "admin"
|
||||
return is_ldap_user(user) and user.role == UserRole.ADMIN
|
||||
|
||||
|
||||
def validate_password(password: str) -> list[str]:
|
||||
|
||||
Reference in New Issue
Block a user