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, userAccessor
 
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, UserChecker userChecker)
          Deprecated. since 5.1. Use EditGlobalPermissionsAdministrator(com.atlassian.confluence.security.SpacePermissionManager, PermissionResolver, com.atlassian.confluence.security.SetSpacePermissionChecker, com.atlassian.confluence.user.SearchEntitiesManager, com.atlassian.confluence.util.UserChecker, com.atlassian.confluence.user.UserAccessor)
protected EditGlobalPermissionsAdministrator(SpacePermissionManager spacePermissionManager, PermissionResolver permissionResolver, SetSpacePermissionChecker setSpacePermissionChecker, SearchEntitiesManager searchEntitiesManager, UserChecker userChecker)
          Deprecated. since 5.3. Use EditGlobalPermissionsAdministrator(com.atlassian.confluence.security.SpacePermissionManager, PermissionResolver, com.atlassian.confluence.security.SetSpacePermissionChecker, com.atlassian.confluence.user.SearchEntitiesManager, com.atlassian.confluence.util.UserChecker, com.atlassian.confluence.user.UserAccessor)
protected EditGlobalPermissionsAdministrator(SpacePermissionManager spacePermissionManager, PermissionResolver permissionResolver, SetSpacePermissionChecker setSpacePermissionChecker, SearchEntitiesManager searchEntitiesManager, UserChecker userChecker, UserAccessor userAccessor)
           
 
Method Summary
 void addPermission(SpacePermission permissionToAdd)
          Adds the given permission if the current user has permission to do so and updates the current active user count.
 void applyPermissionChanges(java.util.Collection<SpacePermission> oldPermissions, java.util.Collection<SpacePermission> newPermissions)
          Given the old permissions and new permissions, apply necessary permission changes to make old permissions the same as new permissions, then reset the current active user count.
 java.util.Collection<SpacePermission> buildPermissionsFromWebForm(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
 boolean canSetPermissionOnGroup(java.lang.String permission, java.lang.String groupName)
          Returns whether the remote user can set the required permission for the group(used by velocity)
 boolean canSetPermissionOnUser(java.lang.String permission, ConfluenceUser user)
          Returns whether the remote user can set the required permission for the user (used by velocity)
 boolean canSetPermissionOnUser(java.lang.String permission, java.lang.String username)
          Deprecated. Since 5.3 Use canSetPermissionOnUser(String, com.atlassian.confluence.user.ConfluenceUser)
 boolean canSetSystemAdministratorPermission()
          Returns whether the user can set the administrator permissions (used by velocity)
 SpacePermission createGroupGuardPermission(java.lang.String guardPermission, java.lang.String groupName)
          Creates the relevant guard permission for the group
 SpacePermission createUserGuardPermission(java.lang.String guardPermission, ConfluenceUser user)
          Creates the relevant guard permission for the user
 SpacePermission createUserGuardPermission(java.lang.String guardPermission, java.lang.String userName)
          Deprecated. 
 java.lang.String getAdministrativePermissionType()
          Returns the top level permission type applicable to the current scope.
 java.util.Collection<SpacePermission> getInitialPermissionsFromForm(java.util.Map requestParams)
          Retrieve the permissions initial state
 java.util.Collection<SpacePermission> getRequestedPermissionsFromForm(java.util.Map requestParams)
          Retrieve the state of the permissions requested by the user
 void removePermission(SpacePermission permissionToRemove)
          Removes the given permission if the current user has permission to do so and updates the current active user count.
 
Methods inherited from class com.atlassian.confluence.security.administrators.AbstractEditPermissionsAdministrator
addAllPermissions, addGuardPermissionToGroups, addGuardPermissionToUsers, buildPermissionsFromWebForm, canAddPermission, denyAnonymousPermissions, getNumOfGroupEntries, getNumOfUserEntries, isGroupsToAddEmpty, isGroupsToAddTooLarge, isRemoveAllAdminPermissions, isUsersToAddEmpty, isUsersToAddTooLarge, removeAllPermissions, 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

@Deprecated
protected EditGlobalPermissionsAdministrator(SpacePermissionManager spacePermissionManager,
                                                        PermissionResolver permissionResolver,
                                                        SetSpacePermissionChecker setSpacePermissionChecker,
                                                        SearchEntitiesManager searchEntitiesManager,
                                                        SettingsManager settingsManager,
                                                        UserChecker userChecker)
Deprecated. since 5.1. Use EditGlobalPermissionsAdministrator(com.atlassian.confluence.security.SpacePermissionManager, PermissionResolver, com.atlassian.confluence.security.SetSpacePermissionChecker, com.atlassian.confluence.user.SearchEntitiesManager, com.atlassian.confluence.util.UserChecker, com.atlassian.confluence.user.UserAccessor)


EditGlobalPermissionsAdministrator

@Deprecated
protected EditGlobalPermissionsAdministrator(SpacePermissionManager spacePermissionManager,
                                                        PermissionResolver permissionResolver,
                                                        SetSpacePermissionChecker setSpacePermissionChecker,
                                                        SearchEntitiesManager searchEntitiesManager,
                                                        UserChecker userChecker)
Deprecated. since 5.3. Use EditGlobalPermissionsAdministrator(com.atlassian.confluence.security.SpacePermissionManager, PermissionResolver, com.atlassian.confluence.security.SetSpacePermissionChecker, com.atlassian.confluence.user.SearchEntitiesManager, com.atlassian.confluence.util.UserChecker, com.atlassian.confluence.user.UserAccessor)


EditGlobalPermissionsAdministrator

protected EditGlobalPermissionsAdministrator(SpacePermissionManager spacePermissionManager,
                                             PermissionResolver permissionResolver,
                                             SetSpacePermissionChecker setSpacePermissionChecker,
                                             SearchEntitiesManager searchEntitiesManager,
                                             UserChecker userChecker,
                                             UserAccessor userAccessor)
Method Detail

getAdministrativePermissionType

public java.lang.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 and updates the current active user count. Does nothing silently otherwise.

Parameters:
permissionToAdd - the permission you want to add.

removePermission

public void removePermission(SpacePermission permissionToRemove)
Removes the given permission if the current user has permission to do so and updates the current active user count. Does nothing silently otherwise.

Specified by:
removePermission in interface EditPermissionsAdministrator
Overrides:
removePermission in class AbstractEditPermissionsAdministrator
Parameters:
permissionToRemove - the permission you want rid of.

createUserGuardPermission

@Deprecated
public SpacePermission createUserGuardPermission(java.lang.String guardPermission,
                                                            java.lang.String userName)
Deprecated. 

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

createUserGuardPermission

public SpacePermission createUserGuardPermission(java.lang.String guardPermission,
                                                 ConfluenceUser user)
Creates the relevant guard permission for the user

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

createGroupGuardPermission

public SpacePermission createGroupGuardPermission(java.lang.String guardPermission,
                                                  java.lang.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 java.util.Collection<SpacePermission> getInitialPermissionsFromForm(java.util.Map requestParams)
Retrieve the permissions initial state

Returns:
initial state

getRequestedPermissionsFromForm

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

Returns:
requested state

buildPermissionsFromWebForm

public java.util.Collection<SpacePermission> buildPermissionsFromWebForm(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

canSetPermissionOnUser

public boolean canSetPermissionOnUser(java.lang.String permission,
                                      java.lang.String username)
                               throws EntityRuntimeException
Deprecated. Since 5.3 Use canSetPermissionOnUser(String, com.atlassian.confluence.user.ConfluenceUser)

Throws:
EntityRuntimeException

canSetPermissionOnUser

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

Throws:
EntityRuntimeException

canSetPermissionOnGroup

public boolean canSetPermissionOnGroup(java.lang.String permission,
                                       java.lang.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)


applyPermissionChanges

public void applyPermissionChanges(java.util.Collection<SpacePermission> oldPermissions,
                                   java.util.Collection<SpacePermission> newPermissions)
                            throws java.lang.IllegalArgumentException
Given the old permissions and new permissions, apply necessary permission changes to make old permissions the same as new permissions, then reset the current active user count.

Specified by:
applyPermissionChanges in interface EditPermissionsAdministrator
Overrides:
applyPermissionChanges in class AbstractEditPermissionsAdministrator
Parameters:
oldPermissions - - initial permissions
newPermissions - - expected permissions
Throws:
java.lang.IllegalArgumentException


Copyright © 2003-2014 Atlassian. All Rights Reserved.