How can I only allow administrators access to the Source Edit button in the RTE? (AEM 6.5) Is there a permission I can use?
I am trying to avoid turning it on and off from the template.
Solved! Go to Solution.
Views
Replies
Total Likes
We can use the dialog submit call.
$(document).on("click", ".cq-dialog-submit", function (e) { //On submit this is invoked
// Ajax call to servlet here });
An example here - Call any servlet in touchUI dialog |AEM 6.3+ – AEM Queries & Solutions (wordpress.com)
javascript - dialog-ready event does not fire when dialog opens in AEM 6.1? - Stack Overflow
Sling Servlet in AEM – AEM CQ5 Tutorials
Thanks
Hello,
We can have a custom servlet that gets invoked on dialog ready and checks the logged in user against user group that should have access to view the source edit. As a response, it can just be a boolean allowed = true or false. Based on that we can show or hide the sourceedit button.
Thanks
Shubham
That sounds doable. Do you have any documentation you could send me to set this in place?
We can use the dialog submit call.
$(document).on("click", ".cq-dialog-submit", function (e) { //On submit this is invoked
// Ajax call to servlet here });
An example here - Call any servlet in touchUI dialog |AEM 6.3+ – AEM Queries & Solutions (wordpress.com)
javascript - dialog-ready event does not fire when dialog opens in AEM 6.1? - Stack Overflow
Sling Servlet in AEM – AEM CQ5 Tutorials
Thanks
Hi! you can make use of ComponentContext here. Create a sling model, check if the current user is a part of administrators group and then set the decoration true. This would make it non-editable for other users and editable for the users which are a part of administrators user group.
thanks,
Bilal
Views
Likes
Replies