Class EditGlobalPermissionsAdministrator
java.lang.Object
com.atlassian.confluence.impl.security.administrators.DefaultPermissionsAdministrator
com.atlassian.confluence.impl.security.administrators.AbstractEditPermissionsAdministrator
com.atlassian.confluence.impl.security.administrators.EditGlobalPermissionsAdministrator
- All Implemented Interfaces:
- EditPermissionsAdministrator,- PermissionsAdministrator
- Since:
- 7.17
- 
Field SummaryFields inherited from class com.atlassian.confluence.impl.security.administrators.AbstractEditPermissionsAdministratorremoteUserFields inherited from interface com.atlassian.confluence.security.administrators.EditPermissionsAdministratorMAX_ENTRIES
- 
Constructor SummaryConstructorsConstructorDescriptionEditGlobalPermissionsAdministrator(SpacePermissionManager spacePermissionManager, PermissionResolver permissionResolver, SetSpacePermissionChecker setSpacePermissionChecker, UserChecker userChecker, ConfluenceUserResolver userResolver, GroupResolver groupResolver) 
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddPermission(SpacePermission permissionToAdd) Adds the given permission if the current user has permission to do so and updates the current active user count.voidapplyPermissionChanges(Collection<SpacePermission> oldPermissions, 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.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 formbooleancanSetPermissionOnGroup(String permission, String groupName) Returns whether the remote user can set the required permission for the group(used by velocity)booleancanSetPermissionOnUser(String permission, ConfluenceUser user) Returns whether the remote user can set the required permission for the user (used by velocity)booleanReturns whether the user can set the administrator permissions (used by velocity)createGroupGuardPermission(String guardPermission, String groupName) Creates the relevant guard permission for the groupcreateUserGuardPermission(String guardPermission, ConfluenceUser user) Creates the relevant guard permission for the userReturns the top level permission type applicable to the current scope.getInitialPermissionsFromForm(Map requestParams) Retrieve the permissions initial stategetRequestedPermissionsFromForm(Map requestParams) Retrieve the state of the permissions requested by the uservoidremovePermission(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.impl.security.administrators.AbstractEditPermissionsAdministratoraddAllPermissions, addGuardPermissionToGroups, addGuardPermissionToUsers, buildPermissionsFromWebForm, canAddPermission, getNumOfGroupEntries, getNumOfUserEntries, isGroupsToAddEmpty, isGroupsToAddTooLarge, isRemoveAllAdminPermissions, isUsersToAddEmpty, isUsersToAddTooLarge, removeAllPermissions, setGroupsToAdd, setRemoteUser, setRemoteUser, setUsersToAdd, splitPermissionsMethods inherited from class com.atlassian.confluence.impl.security.administrators.DefaultPermissionsAdministratorbuildAnonymousPermissionRow, buildGroupPermissionTable, buildUnlicensedAuthenticatedPermissionRow, buildUserPermissionTable, getPermissionsMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.atlassian.confluence.security.administrators.PermissionsAdministratorbuildAnonymousPermissionRow, buildGroupPermissionTable, buildUnlicensedAuthenticatedPermissionRow, buildUserPermissionTable, getPermissions
- 
Constructor Details- 
EditGlobalPermissionsAdministratorpublic EditGlobalPermissionsAdministrator(SpacePermissionManager spacePermissionManager, PermissionResolver permissionResolver, SetSpacePermissionChecker setSpacePermissionChecker, UserChecker userChecker, ConfluenceUserResolver userResolver, GroupResolver groupResolver) 
 
- 
- 
Method Details- 
getAdministrativePermissionTypeReturns 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
 
- 
addPermissionAdds 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.
 
- 
removePermissionRemoves 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:
- removePermissionin interface- EditPermissionsAdministrator
- Overrides:
- removePermissionin class- AbstractEditPermissionsAdministrator
- Parameters:
- permissionToRemove- the permission you want rid of.
 
- 
createUserGuardPermissionCreates 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
 
- 
createGroupGuardPermissionCreates 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
 
- 
getInitialPermissionsFromFormRetrieve the permissions initial state- Returns:
- initial state
 
- 
getRequestedPermissionsFromFormRetrieve the state of the permissions requested by the user- Returns:
- requested state
 
- 
buildPermissionsFromWebFormpublic 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
 
- 
canSetPermissionOnUserpublic boolean canSetPermissionOnUser(String permission, ConfluenceUser user) throws EntityRuntimeException Returns whether the remote user can set the required permission for the user (used by velocity)- Throws:
- EntityRuntimeException
 
- 
canSetPermissionOnGrouppublic 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
 
- 
canSetSystemAdministratorPermissionpublic boolean canSetSystemAdministratorPermission()Returns whether the user can set the administrator permissions (used by velocity)
- 
applyPermissionChangespublic void applyPermissionChanges(Collection<SpacePermission> oldPermissions, Collection<SpacePermission> newPermissions) throws 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:
- applyPermissionChangesin interface- EditPermissionsAdministrator
- Overrides:
- applyPermissionChangesin class- AbstractEditPermissionsAdministrator
- Parameters:
- oldPermissions- - initial permissions
- newPermissions- - expected permissions
- Throws:
- IllegalArgumentException
 
 
-