Skip to content

Commit

Permalink
Merge branch '1568-1' of github.com:opendatadiscovery/odd-platform in…
Browse files Browse the repository at this point in the history
…to 1568-1
  • Loading branch information
anatolii-yemets committed Feb 20, 2024
2 parents 5d8259c + bb2f4d1 commit 0876771
Showing 1 changed file with 129 additions and 1 deletion.
130 changes: 129 additions & 1 deletion odd-platform-api/src/main/resources/schema/policy_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@
{
"$ref": "#/$defs/data_entity_permission"
},
{
"$ref": "#/$defs/query_example_permissions"
},
{
"$ref": "#/$defs/management_permissions"
},
Expand Down Expand Up @@ -123,6 +126,42 @@
}
}
}
},{
"if": {
"type": "object",
"properties": {
"resource": {
"type": "object",
"properties": {
"type": {
"const": "QUERY_EXAMPLE"
}
},
"required": [
"type"
]
}
},
"required": [
"resource"
]
},
"then": {
"properties": {
"permissions": {
"items": {
"anyOf": [
{
"$ref": "#/$defs/query_example_permissions"
},
{
"$ref": "#/$defs/all_permissions"
}
]
}
}
}
}
},
{
"if": {
Expand Down Expand Up @@ -177,6 +216,9 @@
},
{
"$ref": "#/$defs/data_entity_policy_resource_condition"
},
{
"$ref": "#/$defs/query_example_policy_resource_condition"
}
]
}
Expand Down Expand Up @@ -399,6 +441,76 @@
"maxProperties": 1,
"minProperties": 1
},
"query_example_policy_resource_condition": {
"type": "object",
"additionalProperties": false,
"properties": {
"all": {
"type": "array",
"items": {
"$ref": "#/$defs/query_example_policy_resource_condition"
}
},
"any": {
"type": "array",
"items": {
"$ref": "#/$defs/query_example_policy_resource_condition"
}
},
"eq": {
"$ref": "#/$defs/query_example_policy_resource_condition_unary"
},
"not_eq": {
"$ref": "#/$defs/query_example_policy_resource_condition_unary"
},
"match": {
"$ref": "#/$defs/query_example_policy_resource_condition_unary"
},
"not_match": {
"$ref": "#/$defs/query_example_policy_resource_condition_unary"
}
},
"anyOf": [
{
"required": [
"all"
]
},
{
"required": [
"any"
]
},
{
"required": [
"eq"
]
},
{
"required": [
"not_eq"
]
},
{
"required": [
"match"
]
},
{
"required": [
"not_match"
]
}
]
},
"query_example_policy_resource_condition_unary": {
"type": "object",
"propertyNames": {
"$ref": "#/$defs/query_example_condition_key"
},
"maxProperties": 1,
"minProperties": 1
},
"data_entity_resource_condition_key": {
"type": "string",
"enum": [
Expand All @@ -425,6 +537,12 @@
"term:owner:title"
]
},
"query_example_condition_key": {
"type": "string",
"enum": [
"queryexample:name"
]
},
"data_entity_permission": {
"type": "string",
"enum": [
Expand Down Expand Up @@ -452,7 +570,9 @@
"DATASET_FIELD_DELETE_TERM",
"DATA_ENTITY_GROUP_UPDATE",
"DATA_ENTITY_ATTACHMENT_MANAGE",
"DATA_ENTITY_STATUS_UPDATE"
"DATA_ENTITY_STATUS_UPDATE",
"QUERY_EXAMPLE_DATASET_DELETE",
"QUERY_EXAMPLE_DATASET_CREATE"
]
},
"term_permissions": {
Expand All @@ -466,6 +586,13 @@
"TERM_OWNERSHIP_DELETE"
]
},
"query_example_permissions": {
"type": "string",
"enum": [
"QUERY_EXAMPLE_UPDATE",
"QUERY_EXAMPLE_DELETE"
]
},
"management_permissions": {
"type": "string",
"enum": [
Expand Down Expand Up @@ -509,6 +636,7 @@
"enum": [
"DATA_ENTITY",
"TERM",
"QUERY_EXAMPLE",
"MANAGEMENT"
]
}
Expand Down

0 comments on commit 0876771

Please sign in to comment.