Skip to content

Commit

Permalink
fix(core): during permission checking, only call obj_org once
Browse files Browse the repository at this point in the history
ref: #471 #511
  • Loading branch information
jon-nfc committed Feb 1, 2025
1 parent dbebdaf commit d6cdffd
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions app/access/mixins/permissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,10 +166,6 @@ def has_permission(self, request, view):

view_action = 'delete'

obj_organization: Organization = view.get_obj_organization(
obj = view.get_object()
)

elif (
view.action == 'list'
):
Expand All @@ -183,32 +179,20 @@ def has_permission(self, request, view):

view_action = 'change'

obj_organization: Organization = view.get_obj_organization(
obj = view.get_object()
)

elif (
view.action == 'update'
and request.method == 'PUT'
):

view_action = 'change'

obj_organization: Organization = view.get_obj_organization(
obj = view.get_object()
)

elif(
view.action == 'retrieve'
and request.method == 'GET'
):

view_action = 'view'

obj_organization: Organization = view.get_obj_organization(
obj = view.get_object()
)

elif(
view.action == 'metadata'
and request.method == 'OPTIONS'
Expand Down

0 comments on commit d6cdffd

Please sign in to comment.