Hey ![]()
I’ll start with the question and then give some context:
- How do
propertyPermissions(UAA) work with dataservices’ rpc operations , e.g. “MODIFY_DOCUMENT”?
Context:
We want to make certain fields in documents not editable for some users. More specifically, we have services and users that modify a document, and users shouldn’t be able to change “technical” fields. As a first step I’ve created a authorization definition file with propertyPermissions and propertyRights where no user should have access to a certain field, in this case /Cockpit/AllgemeineDaten/Status.
Authorization.json
A simplified version of the authorization.json that is included with mgmtp.a12.uaa.authorization.child-authorization-definitions
{
"policies": [
{
"name": "Is IDocument",
"rules": [
"#resource instanceof T(com.mgmtp.a12.kernel.md.document.api.IDocument)"
]
},
{
"name": "Policy for ExampleDocumentModel",
"rules": [
"#resource.documentModelId == 'ExampleDocumentModel'"
]
}
],
"propertyPermissions": [
{
"name": "propertyPermission for ExampleDocumentModel",
"policy-refs": [
"Is IDocument",
"Policy for ExampleDocumentModel"
],
"rights-refs": [
"Rights for ExampleDocumentModel"
]
}
],
"propertyRights": [
{
"name": "Rights for ExampleDocumentModel",
"rights": {
"READ": [
...
"Cockpit.AllgemeineDaten.Eingang",
"Cockpit.AllgemeineDaten.Status",
"Cockpit.AllgemeineDaten.Bundesland",
...
],
"WRITE": [
...
"Cockpit.AllgemeineDaten.Eingang",
"Cockpit.AllgemeineDaten.Bundesland",
...
],
}
}
]
}
Now what I hoped that would happen is that dataservices evaluates the propertyPermissions just like permissions. But when I send a “MODIFY_DOCUMENT” rpc request with a modified Status dataservices still accepts the modified document. It seems that the propertyPermissions are not evaluated at all ![]()
So is there a way to set up dataservices in a way that propertyPermissions are evaluated on document updates?
I’ve searched the documentation of DS and UAA (including the UAA training) but couldn’t find anything about how to limit the access of document fields when working with dataservices.
gradle.properties
These are the uaa authorization dependencies I’ve included in the bap server
dependencies {
implementation "com.mgmtp.a12.uaa:uaa-authorization:7.5.1"
implementation "com.mgmtp.a12.uaa:uaa-authorization-spring-boot-autoconfigure:7.5.1"
implementation "com.mgmtp.a12.uaa:uaa-authorization-web-spring-boot-autoconfigure:7.5.1"
implementation 'com.mgmtp.a12.uaa:uaa-authorization-a12-extension:7.5.1'
}