Skip to content

Commit

Permalink
OM-242: added additional checks in create worker mutation
Browse files Browse the repository at this point in the history
  • Loading branch information
sniedzielski committed Aug 21, 2024
1 parent d0574df commit d9ec397
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions worker_voucher/gql_mutations.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ class Input(CreateInsureeInputType):

@classmethod
def async_mutate(cls, user, **data):
if (not user.is_imis_admin
and user.has_perms(WorkerVoucherConfig.gql_worker_voucher_search_all_perms)):
return [{"message": _("workers.user_with_that_permission_cannot_create_worker")}]
user_policyholders = PolicyHolder.objects.filter(
policyholder_user_filter(user)).values_list('id', flat=True)
economic_unit_code = data.pop('economic_unit_code', None)
Expand Down

0 comments on commit d9ec397

Please sign in to comment.