Skip to content

Commit

Permalink
permissions: fix system librarian role only
Browse files Browse the repository at this point in the history
A system librarian should have all the librarian rights.

* Removes the librarian role to the system librarian of Martigny in the
  test fixtures to test this specific case.
* Closes #1340.

Co-Authored-by: Johnny Mariéthoz <[email protected]>
  • Loading branch information
jma committed Nov 5, 2020
1 parent f90cfbd commit 8b52957
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 2 additions & 1 deletion rero_ils/permissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
from .modules.patrons.api import Patron

request_item_permission = Permission(RoleNeed('patron'))
librarian_permission = Permission(RoleNeed('librarian'))
librarian_permission = Permission(
RoleNeed('librarian'), RoleNeed('system_librarian'))
admin_permission = Permission(RoleNeed('admin'))
editor_permission = Permission(RoleNeed('editor'), RoleNeed('admin'))

Expand Down
3 changes: 1 addition & 2 deletions tests/data/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -2767,8 +2767,7 @@
"username": "simonetta",
"phone": "+41324993585",
"roles": [
"system_librarian",
"librarian"
"system_librarian"
],
"patron": {
"expiration_date": "2023-10-07",
Expand Down

0 comments on commit 8b52957

Please sign in to comment.