Expand my Community achievements bar.

SOLVED

User access based on Components in AEM page

Avatar

Level 3

Dear Members - I've come across a scenario. I have an AEM Page which contains 4 components. Based on the User restricted components must be displayed on the page.

NOTE: I am on AEM 6.4

Example:

One group of User - Can access certain components.

Second group of User - Can access other different components.

Can I achieve this using AEM Permission? Any advice on this is appreciated.


Thank you.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

HI,

What did you mean by accessing components?

  • If you mean by accessing components while adding in parsys.

This can be done by just removing permissions of that component from for those particular users, you can do groups segregation and add users on those groups ,which has permission to access those components.

Screen Shot 2018-07-11 at 10.49.07 PM.png

  • if you mean accessing component from runtime,

you can do it with Java + HTL

<sly data-sly-use.render="com.my.package.RenderComp" data-sly-test="${render.isShown}">

....

</sly>

Thanks

Arun



Arun Patidar

View solution in original post

4 Replies

Avatar

Correct answer by
Community Advisor

HI,

What did you mean by accessing components?

  • If you mean by accessing components while adding in parsys.

This can be done by just removing permissions of that component from for those particular users, you can do groups segregation and add users on those groups ,which has permission to access those components.

Screen Shot 2018-07-11 at 10.49.07 PM.png

  • if you mean accessing component from runtime,

you can do it with Java + HTL

<sly data-sly-use.render="com.my.package.RenderComp" data-sly-test="${render.isShown}">

....

</sly>

Thanks

Arun



Arun Patidar

Avatar

Level 3

Not really, let me re-iterate.

I have a Page, there are 4 component:

1. Component 1 & 2 - Should be visible to one user group.

2. Component 3 & 4 - Should be visible to another user group.


Thanks.

Avatar

Level 10

Is this not the scenario that Arun mentioned by setting permissions;

"This can be done by just removing permissions of that component from for those particular users, you can do groups segregation and add users on those groups ,which has permission to access those components."

Avatar

Level 2

In order for this to work you will need to add a property jcr:mixinTypes with value rep:AccessControllable to your custom components.