Is there anyway to set the wcmmode specific to a group or user? Basically have a user that their wcmmode is always disabled so they can preview the site but not edit it? but still have other users as content authors that can make edits?
Solved! Go to Solution.
Views
Replies
Total Likes
Hi,
I don't think there's anything like this OOTB, but it should be simple to do as a filter. Just figure out if the current user is one of these users and call WCMMode.DISABLED.toRequest(request);
Regards,
Justin
Views
Replies
Total Likes
k thanks just seeing if there was a more "elegant" way. for those that need something here's what I created real quick. Basically on an author instance set users to just read permissions and putting this in your page.jsp will flip the switch to wcmmode=disabled
// check permission and change wcm mode on author if ((WCMMode.fromRequest(request) == WCMMode.EDIT)){ Session currentSession = slingRequest.getResourceResolver().adaptTo(Session.class); if (!currentSession.hasPermission(currentPage.getPath(),"set_property")){ WCMMode disabled = WCMMode.DISABLED.toRequest(request); } }
Views
Replies
Total Likes
Hi,
I don't think there's anything like this OOTB, but it should be simple to do as a filter. Just figure out if the current user is one of these users and call WCMMode.DISABLED.toRequest(request);
Regards,
Justin
Views
Replies
Total Likes
Views
Likes
Replies