Skip to content

Commit be39938

Browse files
JakobMiesnerkpsherva
authored andcommitted
permissions: turn permission that checks if user can see notifications into read permssion
* renamed `send-notification-to-patron` into `get-notifications-sent-to-patron` * declare it as backoffice read permission
1 parent 69f47cd commit be39938

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

invenio_app_ils/notifications/views.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def get_notifications_blueprint(_):
3838
"size": fields.Int(validate=[validate.Range(min=1, max=100)]),
3939
}
4040
)
41-
@need_permissions("send-notification-to-patron")
41+
@need_permissions("get-notifications-sent-to-patron")
4242
def get_notifications(
4343
recipient_user_id=None,
4444
pid_type=None,
@@ -69,7 +69,7 @@ def get_notifications(
6969
return {"hits": notifications, "total": len(notifications)}
7070

7171
@blueprint.route("/notifications/<int:id>")
72-
@need_permissions("send-notification-to-patron")
72+
@need_permissions("get-notifications-sent-to-patron")
7373
def get_notification(id):
7474
try:
7575
notification = NotificationsLogs.query.filter_by(id=id).one()

invenio_app_ils/permissions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ def __init__(self, record):
205205
]
206206
_is_backoffice_read_permission = [
207207
"stats-most-loaned",
208-
"send-notification-to-patron",
208+
"get-notifications-sent-to-patron",
209209
]
210210
_is_patron_owner_permission = [
211211
"document-request-decline",

0 commit comments

Comments
 (0)