Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

How to hide a field in AEM6 adaptive form based on logged in user

Avatar

Avatar
Validate 10
Level 1
bhaarats4680380
Level 1

Likes

2 likes

Total Posts

20 posts

Correct Reply

0 solutions
Top badges earned
Validate 10
Validate 1
Boost 1
View profile

Avatar
Validate 10
Level 1
bhaarats4680380
Level 1

Likes

2 likes

Total Posts

20 posts

Correct Reply

0 solutions
Top badges earned
Validate 10
Validate 1
Boost 1
View profile
bhaarats4680380
Level 1

15-10-2015

I'm trying to find a way to hide a particular form field in the Adaptive AEM6 form based on the user that is signed in. I looked a the source code and it seems that the form fields are in .contenxt.xml file. I'm not sure how I can manipulate this to meet the above requirement. 

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Boost 5
Employee
mandeepg6805152
Employee

Likes

7 likes

Total Posts

47 posts

Correct Reply

28 solutions
Top badges earned
Boost 5
Boost 3
Boost 1
Affirm 5
Affirm 3
View profile

Avatar
Boost 5
Employee
mandeepg6805152
Employee

Likes

7 likes

Total Posts

47 posts

Correct Reply

28 solutions
Top badges earned
Boost 5
Boost 3
Boost 1
Affirm 5
Affirm 3
View profile
mandeepg6805152
Employee

15-10-2015

Session userSession = slingRequest.getResourceResolver().adaptTo(Session.class);

String userId =  userSession.getUserID();

You can do many othre things  like getting userManager , authorizable etc once you have the session.

You can set a flag in JS and based on that flag write visibility expression on that field 

Answers (0)