Add wrapper class for loading permission info (Fix #12474)#3910
Add wrapper class for loading permission info (Fix #12474)#3910sbesson merged 4 commits intoome:developfrom
Conversation
|
cc: @will-moore @dpwrussell @jburel @chris-allan @knabar Looks like the wrapper is adding worst case approx. 10ms overhead for a single object return: (That's |
Since no solution for properly loading a Permissions object when the target of a project query (`select d.details.permissions`), this workaround is being added which will allow wrapping a object in HQL (`select new ome.util.PermDetails(d)`) to produce the desired effect.
9d2e487 to
fe086fd
Compare
|
@joshmoore What is the correct way of doing something like this: since this gives me a Query Exception: |
|
I fear we may have just run into https://hibernate.atlassian.net/browse/HHH-2460 |
|
Hmmm - bummer. Doesn't look like that is going to be fixed. Any ideas for a workaround? |
Due to HHH-2460, once the `new PermDetails()` object is selected, other objects can not be selected at the same time. Instead, we now make use of a single top layer `new map` and detect objects based on the key: `new map(p as p_details_permissions)`. Rather than getting a map of perms as `rv[0][0]`, now a map with the map is returned: `rv[0][0]["p_details_permissions"]`.
|
@will-moore : can you give joshmoore@7785939 a try? (We're now deeper into the HHH rabbit hole...) |
|
@joshmoore It's looking good... thanks! |
|
NB: #3919 should be updated before merging. |
|
Adding |
|
Removed breaking as per #3995 (comment) |
There was a problem hiding this comment.
This link generates a Javadoc warning
Constructing Javadoc information...
Standard Doclet version 1.8.0_51
Building tree for all the packages and classes...
/opt/hudson/workspace/OMERO-DEV-merge-build/src/components/model/src/ome/util/PermDetails.java:54: warning - Tag @link: reference not found: Permissions
Building index for all the packages and classes...
|
Pushed |
|
https://ci.openmicroscopy.org/view/DEV/job/OMERO-DEV-merge-integration-python/64/testReport/OmeroPy.test.integration.test_permissions/TestPermissionProjections/ certainly looks good as well as the wrapper class as a workaround. Deferring to the jstree testing team to know whether this has caused some performance issues /cc @pwalczysko? |
|
@joshmoore @sbesson : The last jstree testing was performed on 28 August . No performance issues were detected. Is this date including this PR ? |
|
@pwalczysko definitely, I think this PR was always included in the jstree testing because there is a dependency. |
|
Definitely. This has been out of breaking for over a week (the entire time jstree has been out of breaking). |
|
In that case no objections. |
Add wrapper class for loading permission info (Fix #12474)
|
--no-rebase |
PermDetails objects are being passed to the BasicACLVoter.postProcess method when `new map(x_details_permissions)` is used in the HQL query. Not having access to the original object confuses the security system leading to incorrect can* values. This permits unwrapping of internal PermDetails instances. See: * ome#3910 * https://trello.com/c/QbdB9M8k/115-canchgrp-canchown-bug
Add wrapper class for loading permission info (Fix #12474)
PermDetails objects are being passed to the BasicACLVoter.postProcess method when `new map(x_details_permissions)` is used in the HQL query. Not having access to the original object confuses the security system leading to incorrect can* values. This permits unwrapping of internal PermDetails instances. See: * ome#3910 * https://trello.com/c/QbdB9M8k/115-canchgrp-canchown-bug
PermDetails objects are being passed to the BasicACLVoter.postProcess method when `new map(x_details_permissions)` is used in the HQL query. Not having access to the original object confuses the security system leading to incorrect can* values. This permits unwrapping of internal PermDetails instances. See: * ome/openmicroscopy#3910 * https://trello.com/c/QbdB9M8k/115-canchgrp-canchown-bug
PermDetails objects are being passed to the BasicACLVoter.postProcess method when `new map(x_details_permissions)` is used in the HQL query. Not having access to the original object confuses the security system leading to incorrect can* values. This permits unwrapping of internal PermDetails instances. See: * ome/openmicroscopy#3910 * https://trello.com/c/QbdB9M8k/115-canchgrp-canchown-bug
Since no solution for properly loading a Permissions object
when the target of a project query (
select d.details.permissions),this workaround is being added which will allow wrapping a
object in HQL (
select new ome.util.PermDetails(d)) to producethe desired effect.
Testing
Primary effect of this PR is that the test_permissions.py tests which were marked xfail should start passing:
For there to be further effects, queries will need to be changed from
select d.details.permissionstonew map(d as d_details_permissions).