Skip to content

Commit

Permalink
Template to hide some properties not related to self editor profile
Browse files Browse the repository at this point in the history
  • Loading branch information
litvinovg committed Dec 18, 2023
1 parent ded64ac commit a9144c2
Showing 1 changed file with 156 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
# $This file is distributed under the terms of the license in LICENSE$

@prefix access-individual: <https://vivoweb.org/ontology/vitro-application/auth/individual/> .
@prefix access: <https://vivoweb.org/ontology/vitro-application/auth/vocabulary/> .
@prefix : <https://vivoweb.org/ontology/vitro-application/auth/individual/hide-not-related-property/> .

:PolicyTemplate a access:PolicyTemplate ;
access:priority 5000 ;
access:hasRule :HidePropertyStatementWithBlacklistedProperty ;
access:hasDataSet :SelfEditorHideNotRelatedObjectPropertyDataSet ;
access:hasDataSet :SelfEditorHideNotRelatedDataPropertyDataSet ;
access:hasDataSet :SelfEditorHideNotRelatedFauxObjectPropertyDataSet ;
access:hasDataSet :SelfEditorHideNotRelatedFauxDataPropertyDataSet ;
.

### Hide not related object property data sets

#Object properties

:SelfEditorHideNotRelatedObjectPropertyDataSet a access:DataSet ;
access:hasDataSetKey :SelfEditorHideNotRelatedObjectPropertyDataSetKey ;
access:hasRelatedValueSet access-individual:SelfEditorRoleValueSet ;
access:hasRelatedValueSet access-individual:ObjectPropertyStatementValueSet ;
access:hasRelatedValueSet access-individual:DisplayOperationValueSet ;
access:hasRelatedValueSet :SelfEditorHideNotRelatedObjectPropertyValueSet ;
.

:SelfEditorHideNotRelatedObjectPropertyDataSetKey a access:DataSetKey ;
access:hasKeyComponent access-individual:ObjectProperty ;
access:hasKeyComponent access-individual:SelfEditorRoleUri ;
access:hasKeyComponent access-individual:DisplayOperation ;
.

#Data properties

:SelfEditorHideNotRelatedDataPropertyDataSet a access:DataSet ;
access:hasDataSetKey :SelfEditorHideNotRelatedDataPropertyDataSetKey ;
access:hasRelatedValueSet access-individual:SelfEditorRoleValueSet ;
access:hasRelatedValueSet access-individual:DataPropertyStatementValueSet ;
access:hasRelatedValueSet access-individual:DisplayOperationValueSet ;
access:hasRelatedValueSet :SelfEditorHideNotRelatedDataPropertyValueSet ;
.

:SelfEditorHideNotRelatedDataPropertyDataSetKey a access:DataSetKey ;
access:hasKeyComponent access-individual:DataProperty ;
access:hasKeyComponent access-individual:SelfEditorRoleUri ;
access:hasKeyComponent access-individual:DisplayOperation ;
.

#Faux object properties

:SelfEditorHideNotRelatedFauxObjectPropertyDataSet a access:DataSet ;
access:hasDataSetKey :SelfEditorHideNotRelatedFauxObjectPropertyDataSetKey ;
access:hasRelatedValueSet access-individual:SelfEditorRoleValueSet ;
access:hasRelatedValueSet access-individual:FauxObjectPropertyStatementValueSet ;
access:hasRelatedValueSet access-individual:DisplayOperationValueSet ;
access:hasRelatedValueSet :SelfEditorHideNotRelatedFauxObjectPropertyValueSet ;
.

:SelfEditorHideNotRelatedFauxObjectPropertyDataSetKey a access:DataSetKey ;
access:hasKeyComponent access-individual:FauxObjectProperty ;
access:hasKeyComponent access-individual:SelfEditorRoleUri ;
access:hasKeyComponent access-individual:DisplayOperation ;
.

#Faux data properties

:SelfEditorHideNotRelatedFauxDataPropertyDataSet a access:DataSet ;
access:hasDataSetKey :SelfEditorHideNotRelatedFauxDataPropertyDataSetKey ;
access:hasRelatedValueSet access-individual:SelfEditorRoleValueSet ;
access:hasRelatedValueSet access-individual:FauxDataPropertyStatementValueSet ;
access:hasRelatedValueSet access-individual:DisplayOperationValueSet ;
access:hasRelatedValueSet :SelfEditorHideNotRelatedFauxDataPropertyValueSet ;
.

:SelfEditorHideNotRelatedFauxDataPropertyDataSetKey a access:DataSetKey ;
access:hasKeyComponent access-individual:FauxDataProperty ;
access:hasKeyComponent access-individual:SelfEditorRoleUri ;
access:hasKeyComponent access-individual:DisplayOperation ;
.

#Rule

:HidePropertyStatementWithBlacklistedProperty a access:Rule;
access:hasDecision access-individual:Deny ;
access:requiresCheck :SubjectRoleCheck ;
access:requiresCheck :OperationCheck ;
access:requiresCheck :AccessObjectStatementTypeCheck ;
access:requiresCheck :StatementPredicateCheck ;
access:requiresCheck :RelationCheck ;
.

#Checks

:RelationCheck a access:Check ;
access:useOperator access-individual:SparqlSelectQueryResultsNotContain ;
access:hasTypeToCheck access-individual:StatementSubjectUri ;
access:value access-individual:PersonProfileProximityToResourceUri ;
.

:AccessObjectStatementTypeCheck a access:Check ;
access:useOperator access-individual:Equals ;
access:hasTypeToCheck access-individual:AccessObjectType ;
access:values access-individual:ObjectPropertyStatementValueSet ;
access:values access-individual:DataPropertyStatementValueSet ;
access:values access-individual:FauxObjectPropertyStatementValueSet ;
access:values access-individual:FauxDataPropertyStatementValueSet ;
.

:OperationCheck a access:Check ;
access:useOperator access-individual:Equals ;
access:hasTypeToCheck access-individual:Operation ;
access:values access-individual:DisplayOperationValueSet ;
.

:SubjectRoleCheck a access:Check ;
access:useOperator access-individual:Equals ;
access:hasTypeToCheck access-individual:SubjectRole ;
access:values access-individual:SelfEditorRoleValueSet ;
.

:StatementPredicateCheck a access:Check ;
access:useOperator access-individual:OneOf ;
access:hasTypeToCheck access-individual:StatementPredicateUri ;
access:values :SelfEditorHideNotRelatedObjectPropertyValueSet ;
access:values :SelfEditorHideNotRelatedDataPropertyValueSet ;
access:values :SelfEditorHideNotRelatedFauxObjectPropertyValueSet ;
access:values :SelfEditorHideNotRelatedFauxDataPropertyValueSet ;
.

:AccessObjectUriCheck a access:Check ;
access:useOperator access-individual:OneOf ;
access:hasTypeToCheck access-individual:AccessObjectUri ;
access:values :SelfEditorHideNotRelatedObjectPropertyValueSet ;
access:values :SelfEditorHideNotRelatedDataPropertyValueSet ;
access:values :SelfEditorHideNotRelatedFauxObjectPropertyValueSet ;
access:values :SelfEditorHideNotRelatedFauxDataPropertyValueSet ;
.

#Value sets

:SelfEditorHideNotRelatedObjectPropertyValueSet a access:ValueSet ;
access:containsElementsOfType access-individual:ObjectProperty ;
.

:SelfEditorHideNotRelatedDataPropertyValueSet a access:ValueSet ;
access:containsElementsOfType access-individual:DataProperty ;
.

:SelfEditorHideNotRelatedFauxObjectPropertyValueSet a access:ValueSet ;
access:containsElementsOfType access-individual:FauxObjectProperty ;
.

:SelfEditorHideNotRelatedFauxDataPropertyValueSet a access:ValueSet ;
access:containsElementsOfType access-individual:FauxDataProperty ;
.

0 comments on commit a9144c2

Please sign in to comment.