User access based on Components in AEM page | Community
Skip to main content
Tanmay137
Level 2
Jul 11, 2018 7:06 PM UTC
Solved

User access based on Components in AEM page

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.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
arunpatidar
arunpatidarAccepted solution
New Participant
Jul 11, 2018 8:50 PM UTC

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.

  • 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

4 replies

smacdonald2008
Level 10
Jul 13, 2018 8:27 PM UTC

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."

Translate
Level 2
Nov 16, 2021 3:28 PM UTC

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

Translate
Tanmay137
Tanmay137Author
Level 2
Jul 13, 2018 8:06 PM UTC

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.

Translate
arunpatidar
arunpatidarAccepted solution
New Participant
Jul 11, 2018 8:50 PM UTC

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.

  • 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

Translate
Arun Patidar