You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Dan Klco (Jira)" <ji...@apache.org> on 2023/03/07 13:04:00 UTC
[jira] [Resolved] (SLING-11794) ResourceCollection Cannot Get Properties with Read-Only User
[ https://issues.apache.org/jira/browse/SLING-11794?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Dan Klco resolved SLING-11794.
------------------------------
Resolution: Fixed
Fixed in https://github.com/apache/sling-org-apache-sling-resourcecollection/pull/3
> ResourceCollection Cannot Get Properties with Read-Only User
> ------------------------------------------------------------
>
> Key: SLING-11794
> URL: https://issues.apache.org/jira/browse/SLING-11794
> Project: Sling
> Issue Type: Bug
> Components: Extensions
> Affects Versions: Resource Collections 1.0.0
> Reporter: Dan Klco
> Assignee: Dan Klco
> Priority: Major
> Fix For: Resource Collections 1.0.4
>
> Time Spent: 1.5h
> Remaining Estimate: 0h
>
> The ResourceCollection has a method [getProperties|https://github.com/apache/sling-org-apache-sling-resourcecollection/blob/dfcfd3ca53a7ffec1146a09e850893beea15716e/src/main/java/org/apache/sling/resource/collection/ResourceCollection.java#L72], which returns a [ModifiableValueMap|https://github.com/apache/sling-org-apache-sling-api/blob/24c26e15c534e323a57eb2386befa96a323840a1/src/main/java/org/apache/sling/api/resource/ModifiableValueMap.java], when adapting a [JcrNodeResource|https://github.com/apache/sling-org-apache-sling-jcr-resource/blob/0ce0fb850b3a71d800bc6d9c1e3a869fc5748cb1/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrNodeResource.java] to a ModifiableValueMap, the JcrNodeResource [checks to see if the session has write permissions|https://github.com/apache/sling-org-apache-sling-jcr-resource/blob/0ce0fb850b3a71d800bc6d9c1e3a869fc5748cb1/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrNodeResource.java#L137]. and returns null if not.
> Therefore effectively, if you only have read permissions for the Resource referenced by the Resource collection you cannot get the properties of a ResourceCollection.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)