com.atlassian.confluence.security.actions
Class EditPermissionsHelper

java.lang.Object
  extended bycom.atlassian.confluence.security.actions.EditPermissionsHelper

public class EditPermissionsHelper
extends Object


Field Summary
static org.apache.log4j.Category log
           
static String PARAMETER_PREFIX
           
 
Constructor Summary
EditPermissionsHelper()
           
 
Method Summary
 Collection buildGlobalPermissionsFromWebForm(Map formParameters)
          Given a map containing the web form parameters from a permissions edit, return the list of global permissions that are represented by the form
 Collection buildSpacePermissionsFromWebForm(Space space, Map formParameters)
          Given a map containing the web form parameters from a permissions edit, return the list of global permissions that are represented by the form
 void splitPermissions(Collection existingPermissions, Collection newPermissions, Set permissionsToAdd, Set permissionsToRemove)
          Determine which permissions need to be added or removed.
 void updatePermissions(Map parameters)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

public static final org.apache.log4j.Category log

PARAMETER_PREFIX

public static final String PARAMETER_PREFIX
See Also:
Constant Field Values
Constructor Detail

EditPermissionsHelper

public EditPermissionsHelper()
Method Detail

updatePermissions

public void updatePermissions(Map parameters)

buildGlobalPermissionsFromWebForm

public Collection buildGlobalPermissionsFromWebForm(Map formParameters)
Given a map containing the web form parameters from a permissions edit, return the list of global permissions that are represented by the form

Parameters:
formParameters - the map of form parameters
Returns:
a list of the permissions in the form

buildSpacePermissionsFromWebForm

public Collection buildSpacePermissionsFromWebForm(Space space,
                                                   Map formParameters)
Given a map containing the web form parameters from a permissions edit, return the list of global permissions that are represented by the form

Parameters:
space - the space the permissions are applied to
formParameters - the map of form parameters
Returns:
a list of the permissions in the form

splitPermissions

public void splitPermissions(Collection existingPermissions,
                             Collection newPermissions,
                             Set permissionsToAdd,
                             Set permissionsToRemove)
Determine which permissions need to be added or removed. Given a collection of how permissions are now (existingPermissions) and how you wish the permissions to be (newPermissions), this will populate the collections permissionsToAdd and permissionsToRemove with those permissions that you will need to add or remove to reach the desired state.

Parameters:
existingPermissions - the currently existing permissions
newPermissions - the new state we want these permissions to be in
permissionsToAdd - collection into which permissions that need adding will be placed
permissionsToRemove - collection into which permissions that need removing will be placed


Confluence is developed by Atlassian.