Skip to content

Commit af5c2e9

Browse files
committed
refactor(authz): add scoped grants for annotation-review-service
Replace the public read+write grant to the human-validation graph by a scoped grant for the `annotation-review-service`. This way only this service can write `ext:ReviewAnnotation` resources to that graph. Furthermore, additional scoped grant are added such that the service can read data from the appropriate graphs.
1 parent e3a23df commit af5c2e9

1 file changed

Lines changed: 29 additions & 34 deletions

File tree

config/authorization/decide.lisp

Lines changed: 29 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -185,40 +185,35 @@
185185
:to harvesting
186186
:for "logged-in")
187187

188-
;; our ODRL implementation currently cannot handle scopes, but it would be more secure to do so
189-
; (with-scope "http://services.semantic.works/annotation-review-service"
190-
; (grant (read write)
191-
; :to human-validation
192-
; :for "public"
193-
; ))
194-
195-
; (with-scope "http://services.semantic.works/annotation-review-service"
196-
; (grant (read)
197-
; :to public
198-
; :for "public"
199-
; ))
200-
201-
; (with-scope "http://services.semantic.works/annotation-review-service"
202-
; (grant (read)
203-
; :to harvested-gent
204-
; :for "public"
205-
; ))
206-
207-
; (with-scope "http://services.semantic.works/annotation-review-service"
208-
; (grant (read)
209-
; :to harvested-freiburg
210-
; :for "public"
211-
; ))
212-
213-
; (with-scope "http://services.semantic.works/annotation-review-service"
214-
; (grant (read)
215-
; :to harvested-pdf
216-
; :for "public"
217-
; ))
218-
;; instead we need to give public write access to user reviews
219-
(grant (read write)
220-
:to-graph human-validation
221-
:for-allowed-group "public")
188+
(with-scope "http://services.semantic.works/annotation-review-service"
189+
(grant (read write)
190+
:to-graph human-validation
191+
:for-allowed-group "public"))
192+
193+
(with-scope "http://services.semantic.works/annotation-review-service"
194+
(grant (read)
195+
:to-graph public
196+
:for-allowed-group "public"))
197+
198+
(with-scope "http://services.semantic.works/annotation-review-service"
199+
(grant (read)
200+
:to-graph harvested-gent
201+
:for-allowed-group "public"))
202+
203+
(with-scope "http://services.semantic.works/annotation-review-service"
204+
(grant (read)
205+
:to-graph harvested-freiburg
206+
:for-allowed-group "public"))
207+
208+
(with-scope "http://services.semantic.works/annotation-review-service"
209+
(grant (read)
210+
:to-graph harvested-pdf
211+
:for-allowed-group "public"))
212+
213+
(with-scope "http://services.semantic.works/annotation-review-service"
214+
(grant (read)
215+
:to-graph ai
216+
:for-allowed-group "public"))
222217

223218
(supply-allowed-group "logged-in"
224219
:query "PREFIX session: <http://mu.semte.ch/vocabularies/session/>

0 commit comments

Comments
 (0)