File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
invenio_requests/services Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 1212
1313from datetime import timezone
1414
15+ from invenio_access .context import context_identity
1516from invenio_records_resources .services .records .schema import BaseRecordSchema
1617from marshmallow import (
1718 INCLUDE ,
@@ -96,14 +97,15 @@ class RequestEventSchema(BaseRecordSchema):
9697 def get_permissions (self , obj ):
9798 """Return permissions to act on comments or empty dict."""
9899 is_comment = obj .type == CommentEventType
100+ current_identity = context_identity .get ()
99101 if is_comment :
100102 service = current_requests .request_events_service
101103 return {
102104 "can_update_comment" : service .check_permission (
103- self . context [ "identity" ] , "update_comment" , event = obj
105+ current_identity , "update_comment" , event = obj
104106 ),
105107 "can_delete_comment" : service .check_permission (
106- self . context [ "identity" ] , "delete_comment" , event = obj
108+ current_identity , "delete_comment" , event = obj
107109 ),
108110 }
109111 else :
You can’t perform that action at this time.
0 commit comments