com.atlassian.confluence.security.administrators
Class EditGlobalPermissionsAdministrator

java.lang.Object
  extended by com.atlassian.confluence.security.administrators.DefaultPermissionsAdministrator
      extended by com.atlassian.confluence.security.administrators.AbstractEditPermissionsAdministrator
          extended by com.atlassian.confluence.security.administrators.EditGlobalPermissionsAdministrator
All Implemented Interfaces:
EditPermissionsAdministrator, PermissionsAdministrator

public class EditGlobalPermissionsAdministrator
extends AbstractEditPermissionsAdministrator


Nested Class Summary
 
Nested classes/interfaces inherited from class com.atlassian.confluence.security.administrators.DefaultPermissionsAdministrator
DefaultPermissionsAdministrator.AnonymousPermissionRow, DefaultPermissionsAdministrator.GroupPermissionRow, DefaultPermissionsAdministrator.UserPermissionRow
 
Field Summary
 
Fields inherited from class com.atlassian.confluence.security.administrators.AbstractEditPermissionsAdministrator
PARAMETER_PREFIX, remoteUser, searchEntitiesManager, setSpacePermissionChecker
 
Fields inherited from class com.atlassian.confluence.security.administrators.DefaultPermissionsAdministrator
permissions, spacePermissionManager
 
Fields inherited from interface com.atlassian.confluence.security.administrators.EditPermissionsAdministrator
MAX_ENTRIES
 
Constructor Summary
protected EditGlobalPermissionsAdministrator(SpacePermissionManager spacePermissionManager, PermissionResolver permissionResolver, SetSpacePermissionChecker setSpacePermissionChecker, SearchEntitiesManager searchEntitiesManager, SettingsManager settingsManager)
           
 
Method Summary
 void addPermission(SpacePermission permissionToAdd)
          Adds the given permission if the current user has permission to do so, otherwise does nothing silently.
 Collection<SpacePermission> buildPermissionsFromWebForm(Map formParameters, 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
 boolean canSetPermissionOnGroup(String permission, String groupName)
          Returns whether the remote user can set the required permission for the group(used by velocity)
 boolean canSetPermissionOnUser(String permission, String username)
          Returns whether the remote user can set the required permission for the user (used by velocity)
 boolean canSetSystemAdministratorPermission()
          Returns whether the user can set the administrator permissions (used by velocity)
 SpacePermission createGroupGuardPermission(String guardPermission, String groupName)
          Creates the relevant guard permission for the group
 SpacePermission createUserGuardPermission(String guardPermission, String userName)
          Creates the relevant guard permission for the user
 String getAdministrativePermissionType()
          Returns the top level permission type applicable to the current scope.
 Collection<SpacePermission> getInitialPermissionsFromForm(Map requestParams)
          Retrieve the permissions initial state
 Collection<SpacePermission> getRequestedPermissionsFromForm(Map requestParams)
          Retrieve the state of the permissions requested by the user
 
Methods inherited from class com.atlassian.confluence.security.administrators.AbstractEditPermissionsAdministrator
addAllPermissions, addGuardPermissionToGroups, addGuardPermissionToUsers, applyPermissionChanges, buildPermissionsFromWebForm, canAddPermission, denyAnonymousPermissions, getNumOfGroupEntries, getNumOfUserEntries, isGroupsToAddEmpty, isGroupsToAddTooLarge, isRemoveAllAdminPermissions, isUsersToAddEmpty, isUsersToAddTooLarge, removeAllPermissions, removePermission, setGroupsToAdd, setRemoteUser, setUsersToAdd, splitPermissions
 
Methods inherited from class com.atlassian.confluence.security.administrators.DefaultPermissionsAdministrator
buildAnonymousPermissionRow, buildGroupPermissionTable, buildUserPermissionTable, getPermissions, resetPermissions
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.atlassian.confluence.security.administrators.PermissionsAdministrator
buildAnonymousPermissionRow, buildGroupPermissionTable, buildUserPermissionTable, getPermissions
 

Constructor Detail

EditGlobalPermissionsAdministrator

protected EditGlobalPermissionsAdministrator(SpacePermissionManager spacePermissionManager,
                                             PermissionResolver permissionResolver,
                                             SetSpacePermissionChecker setSpacePermissionChecker,
                                             SearchEntitiesManager searchEntitiesManager,
                                             SettingsManager settingsManager)
Method Detail

getAdministrativePermissionType

public String getAdministrativePermissionType()
Returns the top level permission type applicable to the current scope. That is, the permission that must exist at least once per space, or globally.

Returns:
top level permission type

addPermission

public void addPermission(SpacePermission permissionToAdd)
Adds the given permission if the current user has permission to do so, otherwise does nothing silently.

Parameters:
permissionToAdd - the permission you want rid of.

createUserGuardPermission

public SpacePermission createUserGuardPermission(String guardPermission,
                                                 String userName)
Creates the relevant guard permission for the user

Parameters:
guardPermission - - the name of the guard permission to create
userName - - name of the user to add the permission to
Returns:
spacepermission object for the user

createGroupGuardPermission

public SpacePermission createGroupGuardPermission(String guardPermission,
                                                  String groupName)
Creates the relevant guard permission for the group

Parameters:
guardPermission - - the name of the guard permission to create
groupName - - name of group to add the permission to
Returns:
spacepermission object for the user

getInitialPermissionsFromForm

public Collection<SpacePermission> getInitialPermissionsFromForm(Map requestParams)
Retrieve the permissions initial state

Returns:
initial state

getRequestedPermissionsFromForm

public Collection<SpacePermission> getRequestedPermissionsFromForm(Map requestParams)
Retrieve the state of the permissions requested by the user

Returns:
requested state

buildPermissionsFromWebForm

public Collection<SpacePermission> buildPermissionsFromWebForm(Map formParameters,
                                                               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

canSetPermissionOnUser

public boolean canSetPermissionOnUser(String permission,
                                      String username)
                               throws EntityRuntimeException
Returns whether the remote user can set the required permission for the user (used by velocity)

Throws:
EntityRuntimeException

canSetPermissionOnGroup

public boolean canSetPermissionOnGroup(String permission,
                                       String groupName)
                                throws EntityRuntimeException
Returns whether the remote user can set the required permission for the group(used by velocity)

Throws:
EntityRuntimeException

canSetSystemAdministratorPermission

public boolean canSetSystemAdministratorPermission()
Returns whether the user can set the administrator permissions (used by velocity)



Copyright © 2003-2013 Atlassian. All Rights Reserved.