Skip to content

Commit

Permalink
hotfix-anynomus-user-check (#13)
Browse files Browse the repository at this point in the history
Co-authored-by: Jan <[email protected]>
  • Loading branch information
jdolkowski and Jan authored Apr 23, 2024
1 parent 1ac5ea5 commit dc6587f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions grievance_social_protection/schema.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from django.contrib.auth.models import AnonymousUser

from core import filter_validity
from core.schema import OrderedDjangoFilterConnectionField, OpenIMISMutation
from core.schema import signal_mutation_module_validate
Expand Down Expand Up @@ -107,6 +109,8 @@ def resolve_ticketsStr(self, info, **kwargs):

def resolve_grievance_config(self, info, **kwargs):
user = info.context.user
if type(user) is AnonymousUser:
raise PermissionDenied(_("unauthorized"))
if not user.is_imis_admin:
raise PermissionDenied(_("unauthorized"))
return GrievanceTypeConfigurationGQLType()
Expand Down

0 comments on commit dc6587f

Please sign in to comment.