[
https://issues.apache.org/jira/browse/OAK-7937?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16745923#comment-16745923
]
angela commented on OAK-7937:
-----------------------------
[~stillalex].... fine with me... so my comments here. anyway just 3 of them:
# query engine should be build from latestroot not from getRoot() in order to
make sure you only find persisted cugs (nothing transient should be in the
effective policies). as you had it in the first patch
# i vaguely remember that the effective policies should be immutable. in other
words, one should not be able to modify or pass them to setPolicy/removePolicy.
let's verify that against the spec again and if true also fix it for the
getEffectivePolicies(String path) as well
# tests: i would love to have a bit more tests:
* verify that effective policies don't return transient cugs
* that also policies that are not located at the supported path directly are
included
* immutability (if i remember correctly)
* ...and some benchmarks for performance
otherwise looks good if we decide to go for the query-traversal approach....
but it would definitely be good to have some benchmarks. the benefit of the
query is that it's automatically using the editing session... if we went for
the look-at-hidden HIDDEN_NESTED_CUGS properties we would need to do so on the
nodestate level (or the readonly-tree) and then read the relevant cug-trees
again with the editing contentsession to make sure we have access rights
respected.
and here more details on the alterative option: as far as i remember the
NestedCugHook maintains a hidden structure that points to the next cug down the
hierarchy... that's needed for the permission evaluation to be able to now
where the top cugs are located and if and where they contain nested cugs that
cancel the effect of a given cug... that should allow us to specifically look
at nodes that are known to contain cugs instead of traversing everything and
look at all nodes that might potentically contains cugs (but most likely don't
have one except for some very edge cases where the majority of nodes withing
the supported paths contain cugs... which i would consider pretty unlikely and
a problem with the content design). does that info help?
avoiding introducing new index to avoid troubles: fine with me... but let's
make sure we properly benchmark any of the traversing solutions we end up with
(see above). if it turns out to be very inefficient we would offer a
configuration option that allowed customers to trigger the index-creation.
> Implement CugAccessControlManager.getEffectivePolicies(Set<Principal>
> principals)
> ---------------------------------------------------------------------------------
>
> Key: OAK-7937
> URL: https://issues.apache.org/jira/browse/OAK-7937
> Project: Jackrabbit Oak
> Issue Type: Improvement
> Reporter: angela
> Assignee: Alex Deparvu
> Priority: Major
> Fix For: 1.12
>
>
> today CugAccessControlManager.getEffectivePolicies(Set<Principal> principals)
> returns an empty array and has a comment stating that this is not implemented.
> having thought this through again, i think there was some benefit in having
> the implementation. as long as the given set of principal does NOT include
> everyone the return value should just include the CUG-policies that
> explicitly list any of principals. IF _everyone_ was part of the set, the
> return-value basically includes _all_ CUG-policies, because every CUG will
> deny read-access for everyone except for the principals explicitly listed in
> the CUG-policy... if we do the latter as lazy as possible it might still be
> doable even in a scenario, when there are tons of CUG-policies specified.
> [~stillalex], wdyt? do you want to take care of this?
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)