I'm currently try to find the way how I can restrict the using "source mode" for RTE only for administrator.
So I need to get a current user in js. I found out that for Classic UI we can use "CQ.User.getCurrentUser(). What is the way to get this User on Touch UI?
Or it will be better to use Java API for this and then make ajax call from jquery.
Thanks in advance!
Solved! Go to Solution.
Hello antond26624417
You can create a rep:policy node on your component to restrict this access.
1) Go to /useradmin
2) Deny permissions for everyone group on the misctools under your RTEplugins node
3) Admin user, and any member of administrator's group will have access to this node and therefore the sourceedit feature as well.
Hope this approach helps.
Regards,
Aneet Arora
This use case will be implemented via JS.
I am talking to our touch ui experts to get more details for you!
smacdonald2008 Thanks!
Views
Replies
Total Likes
Our touch ui expert relied -
Here is a sample http://experience-aem.blogspot.com/2018/07/aem-64-touch-ui-show-checked-out-user-in-content-fragment...
function getLoggedInUserID(){
return window.sessionStorage.getItem("granite.shell.badge.user");
}
Hello antond26624417
You can create a rep:policy node on your component to restrict this access.
1) Go to /useradmin
2) Deny permissions for everyone group on the misctools under your RTEplugins node
3) Admin user, and any member of administrator's group will have access to this node and therefore the sourceedit feature as well.
Hope this approach helps.
Regards,
Aneet Arora
smacdonald2008 Not sure this object exist for me, since It always returns null.
Also I need to check that this user should belong to "administrators" group.
It's not clear how we can use javascript in comparison with Java API.
Views
Replies
Total Likes
In that article that Sreekanth suggest you look at - you can see an example of using JavaScript. In this user case - you want to modify RTE source view based on the user. To do this - you would not use a Java API.
Views
Replies
Total Likes
aneeta45259594 It would be the best one for our case!
Thanks both of you! smacdonald2008
Views
Replies
Total Likes