-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Role merge #1185
Role merge #1185
Conversation
I removed the jest test. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The objMerge must happen in the workspace module before the obj is returned from the response. |
@dbauszus-glx the roles are affecting the layers correctly, but when I tested on tested on 4.8.1 as well and it works as expected where i can only see the dataview visible to my role. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice one! All working for me again!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Role restriction on locales / layers is working for me.
- But merging layer information is not working with roles.
A roles object on a layer of
"roles": {
"super": {
"toggleLocationViewEdits": true
},
}
When I don't have the super role I am still able to toggle editing, i shouldn't be able to do so.
- If I have a default locale containing layers, and try to remove one layer from a specific locale - I hit an error message. This was introduced in PR Merge locale into template #1040 but no longer works on this PR.
e.g.
"locale": {
"layers": {
"test": {},
"test_a": {}
}
},
"locales": {
"UK": {
"layers": {
"test": null
}
}
}
@simon-leech the check on negated roles was borked. this should now work. The negatedRole flag should be assigned for every user without the 'foo' role. "!foo": {
"negatedRole": true
} |
The '*' role will now be spliced into the user_roles array prior to the objMerge. |
A null layer should now remove the layer from layers list. "locale": {
"layers": {
"OSM": {
"display": true,
"format": "tiles",
"URI": "https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png",
"attribution": {
"© OpenStreetMap": "http://www.openstreetmap.org/copyright"
}
}
}
},
"locales": {
"test": {
"layers": {
"OSM": null,
"retailpoints": {}
}
}
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tested this and it looks good to me -
Layer restrictions
Layer null in locale from default locale
Infoj role restrictions
Layer editing role restrictions
All of these were working for me - i tested using a role, two roles and no role and I got the expected outcomes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noticed an issue with filtering and using a filter.current or filter.default.
When you toggle a thematic option in a style you end up with an incorrect SQL WHERE Clause that ends with an AND incorrectly.
Quality Gate passedIssues Measures |
@dbauszus-glx I have updated the tests for the roles utility module! |
Role objects should not be merged in the mapp library when a layer is decorated.
The method to merge role objects has been added to the Roles util module.
The role objects maybe on the local, layer, or any nested object (e.g. infoj entries).
The Roles.objMerge() method will be called before returning a layer or locale from their respective workspace modules.
This makes the Role.filter() method which is only called in the query mod after the layer is returned from getLayer mod redundant.