Wednesday 13 March 2013

How to set permission on a Dam-asset for a component?

Let us see how do we set permissions

How to set permissions for thumbnail-image renditions for a dam asset. for example: even if a user does not logged in(where an anonymous user does not have permission to that asset), he can see thumbnail image of that asset, but can not access it.


This can be achieved by setting up following allow node using glob permission policies which allow to set up permission on basis of patterns. This configuration will be required at the node/path where the permission is denied for anonymous user-


    <allow
        jcr:primaryType="rep:GrantACE"
        rep:glob="*cq5dam.thumbnail.*"
        rep:principalName="<anonymous user/ group>"
        rep:privileges="{Name}[jcr:read]"/>


As the thumbnail files in cq5 starts with name - cq5dam.thumbnail, above pattern for glob permissions policy sets up read permission for required user/group for all the files starting with above name under the given path.

No comments:

Post a Comment