[ 
https://issues.apache.org/jira/browse/OAK-12058?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18053485#comment-18053485
 ] 

Angela Schreiber commented on OAK-12058:
----------------------------------------

hi [~joerghoh], i don't think we can just removed the canReadMixinTypes call. 
what should be doable is simplifying

{code}
private Iterable<String> getMixinTypeNames(@NotNull Tree tree) {
        if (tree.hasProperty(JcrConstants.JCR_MIXINTYPES) || 
canReadMixinTypes(tree)) {
            return TreeUtil.getMixinTypeNames(tree);
        } else {
            return TreeUtil.getMixinTypeNames(tree, getReadOnlyTree(tree));
        }
    }
{code}

to 

{code}
private Iterable<String> getMixinTypeNames(@NotNull Tree tree) {
        return TreeUtil.getMixinTypeNames(tree, getReadOnlyTree(tree));
    }
{code}

but we would need verify that it does improve performance. specially for nodes 
deep in the node hierarchy.

> Remove non-required permission check when accessing mixins
> ----------------------------------------------------------
>
>                 Key: OAK-12058
>                 URL: https://issues.apache.org/jira/browse/OAK-12058
>             Project: Jackrabbit Oak
>          Issue Type: Task
>          Components: jcr
>    Affects Versions: 1.90.0
>            Reporter: Joerg Hoh
>            Priority: Major
>
> The JCR Spec does not mention, that access to Mixin and NodeType information 
> can be prevented via access control. 
> Currently {{NodeImpl.canReadMixinTypes()}} 
> ([Github|https://github.com/apache/jackrabbit-oak/blob/f277fe135a2b489bd34cb8d6d0b6e23686466228/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/session/NodeImpl.java#L1344])
>  is invoked by {{NodeImpl.getMixinTypeNames()}}, which itself is called by 
> these 3 API operations
> * {{NodeImpl.addMixin(String)}}
> * {{NodeImpl.getMixinNodeTypes()}}
> * {{NodeImpl.isNodeType()}}
>  Removing this check will avoid a few operations and have a small positive 
> performance impact on the above APIs calls.
>  
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to