Skip to content

Commit

Permalink
Fix add_appliedcontrol permission codename
Browse files Browse the repository at this point in the history
  • Loading branch information
nas-tabchiche committed Sep 26, 2024
1 parent 97e7c72 commit d662eea
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions backend/core/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1827,7 +1827,7 @@ def create_suggested_applied_controls(request, pk):
compliance_assessment = ComplianceAssessment.objects.get(id=pk)
if not RoleAssignment.is_access_allowed(
user=request.user,
perm=Permission.objects.get(codename="create_appliedcontrol"),
perm=Permission.objects.get(codename="add_appliedcontrol"),
folder=compliance_assessment.folder,
):
return Response(status=status.HTTP_403_FORBIDDEN)
Expand Down Expand Up @@ -1933,7 +1933,7 @@ def create_suggested_applied_controls(request, pk):
requirement_assessment = RequirementAssessment.objects.get(id=pk)
if not RoleAssignment.is_access_allowed(
user=request.user,
perm=Permission.objects.get(codename="create_appliedcontrol"),
perm=Permission.objects.get(codename="add_appliedcontrol"),
folder=requirement_assessment.folder,
):
return Response(status=status.HTTP_403_FORBIDDEN)
Expand Down

0 comments on commit d662eea

Please sign in to comment.