Skip to content

Commit

Permalink
ILL request: fix permissions
Browse files Browse the repository at this point in the history
* Fixes permissions when the current user has librarian AND patron
  roles, thus preventing him or her to view/edit an ILL requests on the
  professional interface.
* Closes #1709.

Co-Authored-by: Renaud Michotte <[email protected]>
  • Loading branch information
zannkukai committed Mar 3, 2021
1 parent 30bf6ec commit 6281165
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 can 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 6281165

Please sign in to comment.