Skip to content

Commit

Permalink
Change user profil level requirement on waiver UI (#4183)
Browse files Browse the repository at this point in the history
  • Loading branch information
sambodeme authored Aug 15, 2024
1 parent 212a90e commit b313d60
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions backend/audit/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,21 @@ class SacValidationWaiverAdmin(admin.ModelAdmin):
)
autocomplete_fields = ["report_id"]

def has_add_permission(self, request, obj=None):
return request.user.is_staff

def has_change_permission(self, request, obj=None):
return request.user.is_staff

def has_delete_permission(self, request, obj=None):
return request.user.is_staff

def has_module_permission(self, request, obj=None):
return request.user.is_staff

def has_view_permission(self, request, obj=None):
return request.user.is_staff

def save_model(self, request, obj, form, change):
try:
sac = SingleAuditChecklist.objects.get(report_id=obj.report_id_id)
Expand Down Expand Up @@ -274,6 +289,21 @@ class UeiValidationWaiverAdmin(admin.ModelAdmin):
)
readonly_fields = ("timestamp",)

def has_add_permission(self, request, obj=None):
return request.user.is_staff

def has_change_permission(self, request, obj=None):
return request.user.is_staff

def has_delete_permission(self, request, obj=None):
return request.user.is_staff

def has_module_permission(self, request, obj=None):
return request.user.is_staff

def has_view_permission(self, request, obj=None):
return request.user.is_staff

def save_model(self, request, obj, form, change):
super().save_model(request, obj, form, change)
logger.info(
Expand Down

0 comments on commit b313d60

Please sign in to comment.