Added constraint to check that current user is owner of well's field
Showing
1 changed file
with
103 additions
and
2 deletions
| ... | @@ -377,14 +377,14 @@ arg:kindRef | ... | @@ -377,14 +377,14 @@ arg:kindRef |
| 377 | [ | 377 | [ |
| 378 | sp:object spin:ConstraintViolation ; | 378 | sp:object spin:ConstraintViolation ; |
| 379 | sp:predicate rdf:type ; | 379 | sp:predicate rdf:type ; |
| 380 | - sp:subject _:b55110 ; | 380 | + sp:subject _:b48611 ; |
| 381 | ] | 381 | ] |
| 382 | [ | 382 | [ |
| 383 | sp:object [ | 383 | sp:object [ |
| 384 | sp:varName "message"^^xsd:string ; | 384 | sp:varName "message"^^xsd:string ; |
| 385 | ] ; | 385 | ] ; |
| 386 | sp:predicate rdfs:label ; | 386 | sp:predicate rdfs:label ; |
| 387 | - sp:subject _:b55110 ; | 387 | + sp:subject _:b48611 ; |
| 388 | ] | 388 | ] |
| 389 | ) ; | 389 | ) ; |
| 390 | sp:where ( | 390 | sp:where ( |
| ... | @@ -435,6 +435,107 @@ arg:kindRef | ... | @@ -435,6 +435,107 @@ arg:kindRef |
| 435 | ] | 435 | ] |
| 436 | ) ; | 436 | ) ; |
| 437 | ] ; | 437 | ] ; |
| 438 | + spin:constraint [ | ||
| 439 | + rdf:type sp:Construct ; | ||
| 440 | + sp:templates ( | ||
| 441 | + [ | ||
| 442 | + sp:object spin:ConstraintViolation ; | ||
| 443 | + sp:predicate rdf:type ; | ||
| 444 | + sp:subject _:b96757 ; | ||
| 445 | + ] | ||
| 446 | + [ | ||
| 447 | + sp:object [ | ||
| 448 | + sp:varName "message"^^xsd:string ; | ||
| 449 | + ] ; | ||
| 450 | + sp:predicate rdfs:label ; | ||
| 451 | + sp:subject _:b96757 ; | ||
| 452 | + ] | ||
| 453 | + ) ; | ||
| 454 | + sp:where ( | ||
| 455 | + [ | ||
| 456 | + sp:object [ | ||
| 457 | + sp:varName "wellName"^^xsd:string ; | ||
| 458 | + ] ; | ||
| 459 | + sp:predicate <http://www.epim.no/schemas/mprml/1#nameWell> ; | ||
| 460 | + sp:subject spin:_this ; | ||
| 461 | + ] | ||
| 462 | + [ | ||
| 463 | + rdf:type sp:Bind ; | ||
| 464 | + sp:expression [ | ||
| 465 | + rdf:type rhspin:npdIndividualByName ; | ||
| 466 | + arg:name [ | ||
| 467 | + sp:varName "wellName"^^xsd:string ; | ||
| 468 | + ] ; | ||
| 469 | + arg:type <http://www.reportinghub.no/ep/schema/well#Well> ; | ||
| 470 | + ] ; | ||
| 471 | + sp:variable [ | ||
| 472 | + sp:varName "well"^^xsd:string ; | ||
| 473 | + ] ; | ||
| 474 | + ] | ||
| 475 | + [ | ||
| 476 | + rdf:type sp:Filter ; | ||
| 477 | + sp:expression [ | ||
| 478 | + rdf:type sp:bound ; | ||
| 479 | + sp:arg1 [ | ||
| 480 | + sp:varName "well"^^xsd:string ; | ||
| 481 | + ] ; | ||
| 482 | + ] ; | ||
| 483 | + ] | ||
| 484 | + [ | ||
| 485 | + rdf:type sp:NamedGraph ; | ||
| 486 | + sp:elements ( | ||
| 487 | + [ | ||
| 488 | + sp:object [ | ||
| 489 | + sp:varName "field"^^xsd:string ; | ||
| 490 | + ] ; | ||
| 491 | + sp:predicate <http://www.reportinghub.no/np/schema/npd#wellPartOfField> ; | ||
| 492 | + sp:subject [ | ||
| 493 | + sp:varName "well"^^xsd:string ; | ||
| 494 | + ] ; | ||
| 495 | + ] | ||
| 496 | + [ | ||
| 497 | + sp:object [ | ||
| 498 | + sp:varName "fieldName"^^xsd:string ; | ||
| 499 | + ] ; | ||
| 500 | + sp:predicate <http://www.reportinghub.no/np/schema/npd#name> ; | ||
| 501 | + sp:subject [ | ||
| 502 | + sp:varName "field"^^xsd:string ; | ||
| 503 | + ] ; | ||
| 504 | + ] | ||
| 505 | + ) ; | ||
| 506 | + sp:graphNameNode <http://www.reportinghub.no/np/data/npd> ; | ||
| 507 | + ] | ||
| 508 | + [ | ||
| 509 | + rdf:type sp:Filter ; | ||
| 510 | + sp:expression [ | ||
| 511 | + rdf:type sp:not ; | ||
| 512 | + sp:arg1 [ | ||
| 513 | + rdf:type rhspin:currentUserIsOperatorOfFieldWithName ; | ||
| 514 | + arg:fieldName [ | ||
| 515 | + sp:varName "fieldName"^^xsd:string ; | ||
| 516 | + ] ; | ||
| 517 | + ] ; | ||
| 518 | + ] ; | ||
| 519 | + ] | ||
| 520 | + [ | ||
| 521 | + rdf:type sp:Bind ; | ||
| 522 | + sp:expression [ | ||
| 523 | + rdf:type fn:concat ; | ||
| 524 | + sp:arg1 "Your company is not the operator of the field " ; | ||
| 525 | + sp:arg2 [ | ||
| 526 | + sp:varName "fieldName"^^xsd:string ; | ||
| 527 | + ] ; | ||
| 528 | + sp:arg3 " that contains the well " ; | ||
| 529 | + sp:arg4 [ | ||
| 530 | + sp:varName "wellName"^^xsd:string ; | ||
| 531 | + ] ; | ||
| 532 | + ] ; | ||
| 533 | + sp:variable [ | ||
| 534 | + sp:varName "message"^^xsd:string ; | ||
| 535 | + ] ; | ||
| 536 | + ] | ||
| 537 | + ) ; | ||
| 538 | + ] ; | ||
| 438 | . | 539 | . |
| 439 | <http://www.reportinghub.no/ep/spin/mpr-proxy-constraints> | 540 | <http://www.reportinghub.no/ep/spin/mpr-proxy-constraints> |
| 440 | rdf:type owl:Ontology ; | 541 | rdf:type owl:Ontology ; | ... | ... |
-
Please register or login to post a comment