From a9144c23a1024ffad078b66fa800600726f805a5 Mon Sep 17 00:00:00 2001 From: Georgy Litvinov Date: Mon, 18 Dec 2023 18:11:17 +0100 Subject: [PATCH] Template to hide some properties not related to self editor profile --- .../template_hide_not_related_property.n3 | 156 ++++++++++++++++++ 1 file changed, 156 insertions(+) create mode 100644 home/src/main/resources/rdf/accessControl/firsttime/template_hide_not_related_property.n3 diff --git a/home/src/main/resources/rdf/accessControl/firsttime/template_hide_not_related_property.n3 b/home/src/main/resources/rdf/accessControl/firsttime/template_hide_not_related_property.n3 new file mode 100644 index 0000000000..1e934d8ac8 --- /dev/null +++ b/home/src/main/resources/rdf/accessControl/firsttime/template_hide_not_related_property.n3 @@ -0,0 +1,156 @@ +# $This file is distributed under the terms of the license in LICENSE$ + +@prefix access-individual: . +@prefix access: . +@prefix : . + +: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 ; + .