Skip to content

Commit

Permalink
Request: fix permissions
Browse files Browse the repository at this point in the history
If the current user had role librarian AND role patron, it couln't
view/edit an ILL requests into the admin interface.

Closes #1709.

Co-Authored-by: Renaud Michotte <[email protected]>
  • Loading branch information
zannkukai committed Feb 22, 2021
1 parent 2955915 commit f6c99b2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions rero_ils/modules/ill_requests/permissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@ def read(cls, user, record):
:return: True is action can be done.
"""
if current_patron:
# patron an only read their own requests
if current_patron.is_patron:
return record.patron_pid == current_patron.pid
# staff member (lib, sys_lib) can always read request from their
# own organisation
if current_patron.is_librarian:
return current_organisation.pid \
== ILLRequest(record).organisation_pid
# patron an only read their own requests
if current_patron.is_patron:
return record.patron_pid == current_patron.pid
return False

@classmethod
Expand Down

0 comments on commit f6c99b2

Please sign in to comment.