Add contractor manager role.
This commit is contained in:
parent
9cadf4eed5
commit
5971860c4f
7 changed files with 15 additions and 6 deletions
|
|
@ -45,6 +45,10 @@ class Command(BaseCommand):
|
|||
"name": "ستاد آبمنطقهای",
|
||||
"slug": UserRoles.HEADQUARTER,
|
||||
},
|
||||
{
|
||||
"name": "مدیر پیمانکار",
|
||||
"slug": UserRoles.CONTRACTOR_MANAGER,
|
||||
},
|
||||
]
|
||||
|
||||
for role in roles:
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue