Highlighted

AEM Assets select action

anshus83799232

20-05-2018

Hi All,

Need help with a requirement. I have to hide certain select actions in assets.html for some particular user group (hide Manage tags, To Collection, Copy etc). Currently we get all the below options on selection.

Screen Shot 2018-05-21 at 10.13.27 AM.png

I overlayed the action selection node and tried hideChildren but it hides these options for all the users including admin (which is obvious so I can't use this way) and I also tried applying rep:policy but somehow these policies don't work and the options load from some render condition JSPs. I cannot modify these OOTB JSPs so please suggest me something which will work here. I am not sure how to do it via JS. Can anyone help me on this?

Replies

Highlighted

Vijayalakshmi_S

MVP

22-05-2018

HI,

Can you try adding rendercondition for the actions(overlayed in apps) that you would like to show/hide for certain user groups.

OOB : PrivilegeRenderCondition - PrivilegeRenderCondition ("The Adobe AEM Quickstart and Web Application.")

Usage:

  • Create a node named "granite:rendercondition" under the action desired
    • Add properties named "sling:resourceType" -> granite/ui/components/coral/foundation/renderconditions/privilege
    • path and privileges - indicatiing path and privilege types to refrain user groups.

You can also try creating custom render conditions based on your need and add it to actions as mentioned in the usage where

  • sling:resourceType would point to the render condition JSP that you have written.
  • custom properties that you would like to fetch in your JSP can be added and same would be available in ComponentConfig     (cmp.getConfig() where cmp -> ComponentHelper object available from global.jsp)

Reference for writing custom Render condition : /libs/granite/ui/components/coral/foundation/renderconditions/privilege/privilege.jsp

Highlighted

mkumar

08-08-2019

Hello Community,

I have similar requirement. I need to provide the Delete button only if the asset is created by the editing user and should be hidden to rest of the users.

I am unable to achieve this through render condition actions as it's a generic to asset details html/page.

Please let me know if your suggestions.

Thanks,

Vinay

Highlighted

Arun_Patidar

MVP

08-08-2019

you need to overlay delete button and add one more renderrer with AND condition at /apps/dam/gui/content/assets/jcr:content/actions/selection/delete/granite:rendercondition like 

/libs/dam/gui/content/assets/jcr:content/actions/selection/create/granite:rendercondition