Using Velocity, how does one get page permissions? I'm ultimately looking to develop an permission indicator system (using a series of icons) that will display if the user/group has permission to a space, set of pages (heirarchy), and/or a single page itself.
I've read how to get user permissions but this wouldn't solve the problem I'm facing such as the following:
#set ($pagePermission = $permissionHelper.canView($remoteUser, $action.page))
Thanks!
So I believe I figured it out.
## get space-level permissions #foreach ($permission in $space.getPermissions()) #set($spacePermission = $spacePermission + "@@" + $permission) ## get permissions #end ## get page-level permissions #set ($groupPagePermissions = $<proprietaryHelper>.contentPermissionManager.getContentPermissionSets($page, "View"))
This code is added to the Page Layout and from there, I send off the $spacePermission and $groupPagePermissions to JavaScript and use the indexOf method to find groupName and users I'm looking for. Then, JavaScript displays the icons based on a few if/else statements.
Atlassian Government Cloud has achieved FedRAMP Authorization at the Moderate level! Join our webinar to learn how you can accelerate mission success and move work forward faster in cloud, all while ensuring your critical data is secure.
Register NowOnline forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.