Hi Team,
I have a website in AEM Cloud, where once the user is authenticated, I want them to see page according to their permissions.
How can I restrict the users to see only some of the page in navigation bar but not all as per their permission in authenticated group.
Thanks,
SD
Solved! Go to Solution.
Views
Replies
Total Likes
Hi @SDusane
we had implement same using:
CUG : To protect page(s)/tree
LinkTransformer : To add a hide class or custom data attribute 'cug-protected-link' to all protected links while generating page. Alternatively you can do same in sling model if this is just for navigation component. we had to apply this globally so went with sling rewrite pipeline.
Servlet : Calling a servlet(POST with all the 'cug-protected-link' links ) on page load, servlet will return a json response with payload links and visibility status based on user(current session).
based on servlet response unhide 'cug-protected-link'.
considering creating dictionary with expiry in user's localStorge will help to reduce number of call to server and help with performance.
You can use sling model to fetch the groups associated with the user and check if user is part of the required group.
Then you can show/hide html elements conditionally in navigation bar by calling that sling model in sightly code using use API
Hi @SDusane
we had implement same using:
CUG : To protect page(s)/tree
LinkTransformer : To add a hide class or custom data attribute 'cug-protected-link' to all protected links while generating page. Alternatively you can do same in sling model if this is just for navigation component. we had to apply this globally so went with sling rewrite pipeline.
Servlet : Calling a servlet(POST with all the 'cug-protected-link' links ) on page load, servlet will return a json response with payload links and visibility status based on user(current session).
based on servlet response unhide 'cug-protected-link'.
considering creating dictionary with expiry in user's localStorge will help to reduce number of call to server and help with performance.
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies