Add contractor manager role.

This commit is contained in:
aminhashemi92 2025-12-19 20:00:16 +03:30
parent 9cadf4eed5
commit 5971860c4f
7 changed files with 15 additions and 6 deletions

View file

@ -45,6 +45,10 @@ class Command(BaseCommand):
"name": "ستاد آب‌منطقه‌ای",
"slug": UserRoles.HEADQUARTER,
},
{
"name": "مدیر پیمانکار",
"slug": UserRoles.CONTRACTOR_MANAGER,
},
]
for role in roles:

View file

@ -58,3 +58,7 @@ def is_headquarter(user):
def is_customer(user):
return _has_profile(user) and user.profile.has_role(UserRoles.CUSTOMER)
@register.filter
def is_contractor_manager(user):
return _has_profile(user) and user.profile.has_role(UserRoles.CONTRACTOR_MANAGER)