com.atlassian.confluence.security.actions
Class EditPermissionsHelper

java.lang.Object
  extended by com.atlassian.confluence.security.actions.EditPermissionsHelper

public class EditPermissionsHelper
extends java.lang.Object


Field Summary
static org.apache.log4j.Category log
           
static java.lang.String PARAMETER_PREFIX
           
 
Constructor Summary
EditPermissionsHelper()
           
 
Method Summary
 java.util.Collection buildGlobalPermissionsFromWebForm(java.util.Map formParameters, java.lang.String parameterQualifier)
          Given a map containing the web form parameters from a permissions edit, return the list of global permissions that are represented by the form
 java.util.Collection buildSpacePermissionsFromWebForm(Space space, java.util.Map formParameters, java.lang.String parameterQualifier)
          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(java.util.Collection existingPermissions, java.util.Collection initialPermissions, java.util.Collection requestedPermissions, java.util.Set permissionsToAdd, java.util.Set permissionsToRemove)
          Determine which permissions need to be added or removed.
 void updatePermissions(java.util.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 java.lang.String PARAMETER_PREFIX
See Also:
Constant Field Values
Constructor Detail

EditPermissionsHelper

public EditPermissionsHelper()
Method Detail

updatePermissions

public void updatePermissions(java.util.Map parameters)

buildGlobalPermissionsFromWebForm

public java.util.Collection buildGlobalPermissionsFromWebForm(java.util.Map formParameters,
                                                              java.lang.String parameterQualifier)
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
parameterQualifier - distinguishes the set of parameters from other sets of parameters used to represent permissions in the same form.
Returns:
a list of the permissions in the form

buildSpacePermissionsFromWebForm

public java.util.Collection buildSpacePermissionsFromWebForm(Space space,
                                                             java.util.Map formParameters,
                                                             java.lang.String parameterQualifier)
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
parameterQualifier - distinguishes the set of parameters from other sets of parameters used to represent permissions of the same space in the same form.
Returns:
a list of the permissions in the form

splitPermissions

public void splitPermissions(java.util.Collection existingPermissions,
                             java.util.Collection initialPermissions,
                             java.util.Collection requestedPermissions,
                             java.util.Set permissionsToAdd,
                             java.util.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
initialPermissions - the permissions the user was initially shown
requestedPermissions - 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


Copyright © 2003-2008 Atlassian Pty Ltd. All Rights Reserved.