behruz #150
@@ -6,11 +6,6 @@ from core.apps.accounts.choices import RoleChoice
|
|||||||
|
|
||||||
class IsAdminRole(BasePermission):
|
class IsAdminRole(BasePermission):
|
||||||
def has_permission(self, request, view):
|
def has_permission(self, request, view):
|
||||||
if not request.user.is_authenticated:
|
if request.user and request.user.role in [RoleChoice.ADMIN, RoleChoice.SUPERUSER]:
|
||||||
return False
|
|
||||||
|
|
||||||
if request.user.role not in [RoleChoice.ADMIN ,RoleChoice.SUPERUSER]:
|
|
||||||
raise PermissionDenied("Only admin can access this")
|
|
||||||
return True
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +0,0 @@
|
|||||||
# Generated by Django 5.2.7 on 2026-05-06 12:15
|
|
||||||
|
|
||||||
from django.db import migrations
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
|
||||||
|
|
||||||
dependencies = [
|
|
||||||
("evaluation", "0047_autoevaluationmodel_tender_contract_date_and_more"),
|
|
||||||
("evaluation", "0048_autoevaluation_customer_fields"),
|
|
||||||
]
|
|
||||||
|
|
||||||
operations = []
|
|
||||||
Reference in New Issue
Block a user