45
45
{" @id" " ex:ssnRestriction"
46
46
" @type" [" f:AccessPolicy" " ex:EmployeePolicy" ]
47
47
" f:onProperty" [{" @id" " schema:ssn" }]
48
+ " f:required" true
48
49
" f:action" [{" @id" " f:view" } {" @id" " f:modify" }]
49
50
" f:query" {" @type" " @json"
50
51
" @value" {" @context" {" ex" " http://example.org/ns/" }
272
273
" @type" [" f:AccessPolicy" " ex:EmployeePolicy" ]
273
274
" f:onProperty" [{" @id" " schema:ssn" }]
274
275
" f:action" [{" @id" " f:view" } {" @id" " f:modify" }]
276
+ " f:required" true
275
277
" f:query" {" @type" " @json"
276
278
" @value" {" @context" {" ex" " http://example.org/ns/" }
277
279
" where" {" @id" " ?$identity"
295
297
(json/write-value-as-string
296
298
(assoc secret-query
297
299
" opts" {" policyClass" " ex:EmployeePolicy"
298
- " policyValues" { " ?$identity" alice-did} }))
300
+ " policyValues" [ " ?$identity" [ alice-did]] }))
299
301
:headers json-headers}
300
302
query-res (api-post :query query-req)]
301
303
315
317
schema:ssn ?ssn.}" )
316
318
:headers (assoc sparql-headers
317
319
" Fluree-Policy-Class" " ex:EmployeePolicy"
318
- " Fluree-Policy-Values" (json/write-value-as-string { " ?$identity" alice-did} ))}
320
+ " Fluree-Policy-Values" (json/write-value-as-string [ " ?$identity" [ alice-did]] ))}
319
321
query-res (api-post :query query-req)]
320
322
321
323
(is (= [[" ex:alice" " 111-11-1111" ]]
369
371
" @type" [" f:AccessPolicy" " ex:EmployeePolicy" ]
370
372
" f:onProperty" [{" @id" " schema:ssn" }]
371
373
" f:action" [{" @id" " f:view" } {" @id" " f:modify" }]
374
+ " f:required" true
372
375
" f:query" {" @type" " @json"
373
376
" @value" {" @context" {" ex" " http://example.org/ns/" }
374
377
" where" {" @id" " ?$identity"
378
381
" f:action" {" @id" " f:view" }
379
382
" f:query" {" @type" " @json"
380
383
" @value" {}}}]}
381
- policy-values { " ?$identity" alice-did}
384
+ policy-values [ " ?$identity" [ alice-did]]
382
385
query-req {:body
383
386
(json/write-value-as-string
384
387
(assoc secret-query
408
411
409
412
(is (= [[" ex:alice" " 111-11-1111" ]]
410
413
(-> query-res :body json/read-value))
411
- " query policy opts should prevent seeing john's ssn" ))))))
414
+ " query policy opts should prevent seeing john's ssn" ))))))
0 commit comments