Skip to content
ttorvela edited this page Sep 29, 2014 · 4 revisions

Welcome to the Space Permissions Handler for Confluence wiki!

Space Permissions Handler for Confluence is a Confluence plugin that allows viewing user's space permissions for all Confluence spaces from one view. One user's space permissions can also be copied to another user. You can use this feature for example if you need to migrate an old user account to a new one. Some times it is not possible to just rename the user but using this plugin you can make the migration faster. At the moment plugin handles only space permissions. For example page restrictions are not copied.

**Plugin needs to go through all wiki spaces and their permissions. This is a very data intensive process! Administrators should make sure that using the plugin does not slow down the installation too much. **

User Guide

Installation

Plug-in will be available from Atlassian Marketplace. You can also find the latest development version under GitHub repository's jar folder. Confluence's documentation describes how you can upload the downloaded jar file to your Confluence installation.

Start using the plugin

After installing the plugin to your Confluence installation you can find the plugin form Confluence's Administration Console. You will need administrator's access rights to access and use the plug-in.

Space Permissions Handler is located at Admin Console's left navigation panel

Viewing user's all space permissions

To see a user's all space permissions start writing user's name to the From username: field as shown in the screenshot above. Select the user from the pop-up menu or write the entire username to the field. To view the permissions press enter or select View button.

Copying user's all space permissions to another user

Input the username whose permissions will be copied to the From username: field. Input the target username to the To username: field. If you wish to copy all possible permissions to the target user then select Copy.

Group permissions

Source user's group permissions are marked with star character *. User has these permissions through a group membership or they have been assigned to Anonymous.

Copy only user permissions (ignore permissions from groups) option

Here user permissions are those permissions that have been assigned directly to the user in space permissions. These permissions are listed under Individual Users section in space permissions view. In some situations it might be better to just copy these individual user permissions rather than all effective permissions including group permissions.

When migrating a user account to another account it might be a good idea to first make sure that the new account has the same group memberships as the old account. Then copying the space permissions with or without the Copy only user permissions selection does not matter because the plugin will only assign the user permissions (to Individual Users) when the target user did not have that permission already for example from group memberships.

How permissions are copied?

Here is how the plugin works:

  1. Go through all spaces and check source user's permissions.
  2. Mark the permission as individual user permissions if one is found (even when the user has the same permission from some group membership).
  3. Go through the permissions that will be copied space by space and permission by permission.
  4. Assign the permission to the target user as an individual user permission if the user does not have the permission already (from group membership or from individual user permissions).
  • Don't assign the permission at all if the permission was a not a user permission AND the Copy only user permissions was selected
  1. Display source user's all space permissions.

How to access space permissions settings quickly?

You can access space specific permissions settings quickly after viewing the permissions and by selecting the space's name link.

REST API

After the plug-in is installed you can also use the same REST API that the plugin itself is using to generate the administration view. API supports:

  1. searching (HTTP GET) the permissions to JSON output.
  2. updating the permissions (HTTP PUT) using JSON payload.

GET returns users all space permissions as JSON:

/rest/userpermissions/1.0/{user-id} { "spacePermissions": [ { "spaceName":"Confluence Latest", "spaceKey":"DOC", "permissions":[ { "permissionType":"VIEWSPACE", "permissionGranted":true, "userPermission":false }, { "permissionType":"EDITSPACE", "permissionGranted":true, "userPermission":false }, { "permissionType":"EXPORTPAGE", "permissionGranted":true, "userPermission":false }, { "permissionType":"SETPAGEPERMISSIONS", "permissionGranted":true, "userPermission":false }, { "permissionType":"REMOVEPAGE", "permissionGranted":true, "userPermission":false }, { "permissionType":"EDITBLOG", "permissionGranted":true, "userPermission":false }, { "permissionType":"REMOVEBLOG", "permissionGranted":true, "userPermission":false }, { "permissionType":"COMMENT", "permissionGranted":true, "userPermission":false }, { "permissionType":"REMOVECOMMENT", "permissionGranted":true, "userPermission":false }, { "permissionType":"CREATEATTACHMENT", "permissionGranted":true, "userPermission":false }, { "permissionType":"REMOVEATTACHMENT", "permissionGranted":true, "userPermission":false }, { "permissionType":"REMOVEMAIL", "permissionGranted":true, "userPermission":false }, { "permissionType":"EXPORTSPACE", "permissionGranted":true, "userPermission":false }, { "permissionType":"SETSPACEPERMISSIONS", "permissionGranted":true, "userPermission":false }] } ] }

PUT updates user's permissions according to payload

/rest/userpermissions/1.0/{user-id}?onlyUserPermissions={true/false}

JSON payload for HTTP PUT is in same format as the payload received from HTTP GET. Example of this format is shown above.