Hi,
I want to get the user details in aem touch ui dialog listener. I need to know the user when a particular filed is modified/updated in dialog.
Thanks,
AG
Solved! Go to Solution.
Finally found it.
Granite.author.ContentFrame.getUserID()
to get user id in EDIT mode TOUCH UI js.
If you are looking for change visibility of dialog property based on user permissions / user cred, you can use renderconditions.
Create rendercondition like /libs/granite/ui/components/coral/foundation/renderconditions/privilege and use it on the dialog field like /libs/dam/gui/content/assets/annotate/jcr:content/actions/moveasset/granite:rendercondition.
If you want to get the user details in the dialog field, you should use jackrabit Usermanager API
reference - https://stackoverflow.com/questions/34631873/how-to-get-user-list-of-given-group-in-aem6-1
Dialog widget reference - How can we select the user from Dialog widget
Thanks for writing. I need to the the user who is updating the component in dialog listener (Touch UI). I want to store the user id/name of author who is updating the specific textarea(only) of a component. Assume a component has 5 fields in dialog, AEM stores the lastModifiedBy if any of those fields updated. I want to store the user name only when one(specific filed, say text area) of those five fields got updated.
Thanks.
Views
Replies
Total Likes
I don't know any quick route for this one, but you can implement the below.
1. Create a servlet like /bin/getCurrentUser using logic in [1] (not to create user, but to get current user )
2. The servlet should send back the current user
3. Create a listener for the dialog fields you need and write a listener logic to invoke the servlet and update the response to the specific field.
[1] - Adobe Experience Manager Help | Using Jackrabbit UserManager APIs to create AEM Users and Groups
Finally found it.
Granite.author.ContentFrame.getUserID()
to get user id in EDIT mode TOUCH UI js.
There is an JSON API which return current user details, In case needed somewhere else.
http://localhost:4504/libs/granite/security/currentuser.json