Class AbstractEditPermissionsAdministrator
- java.lang.Object
-
- com.atlassian.confluence.security.administrators.DefaultPermissionsAdministrator
-
- com.atlassian.confluence.security.administrators.AbstractEditPermissionsAdministrator
-
- All Implemented Interfaces:
EditPermissionsAdministrator,PermissionsAdministrator
- Direct Known Subclasses:
EditGlobalPermissionsAdministrator,EditSpacePermissionsAdministrator
@Deprecated public abstract class AbstractEditPermissionsAdministrator extends DefaultPermissionsAdministrator implements EditPermissionsAdministrator
Deprecated.since 7.17 UseAbstractEditPermissionsAdministratorContains all the common functionality of the global and space edit permissions administrators
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.atlassian.confluence.security.administrators.DefaultPermissionsAdministrator
DefaultPermissionsAdministrator.GroupPermissionRow, DefaultPermissionsAdministrator.UnlicensedPermissionRow, DefaultPermissionsAdministrator.UserPermissionRow
-
-
Field Summary
Fields Modifier and Type Field Description static StringPARAMETER_PREFIXDeprecated.protected com.atlassian.user.UserremoteUserDeprecated.protected SetSpacePermissionCheckersetSpacePermissionCheckerDeprecated.protected UserAccessoruserAccessorDeprecated.-
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
Constructors Modifier Constructor Description protectedAbstractEditPermissionsAdministrator(SpacePermissionManager spacePermissionManager, PermissionResolver permissionResolver, SetSpacePermissionChecker setSpacePermissionChecker, UserAccessor userAccessor)Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddAllPermissions(Set<SpacePermission> permissionsToAdd)Deprecated.Adds the given set of permissions if the current user has permission to do so, otherwise does nothing silently.List<String>addGuardPermissionToGroups(List<String> groupNames, UserAccessor userAccessor, String guardPermission)Deprecated.Add the guard permissions for each group if they existList<String>addGuardPermissionToGroups(List<String> groupNames, String guardPermission)Deprecated.Add the guard permissions for each group if they existList<String>addGuardPermissionToUsers(List<String> userNames, UserAccessor userAccessor, String guardPermission)Deprecated.Add the guard permissions for each user if they existList<String>addGuardPermissionToUsers(List<String> userNames, String guardPermission)Deprecated.Add the guard permissions for each user if they existvoidapplyPermissionChanges(Collection<SpacePermission> oldPermissions, Collection<SpacePermission> newPermissions)Deprecated.Given the old permissions and new permissions, apply necessary permission changes to make old permissions the same as new permissionsprotected Collection<SpacePermission>buildPermissionsFromWebForm(Space space, Map<String,?> formParameters, String parameterQualifier)Deprecated.Private implementation that doesn't check to ensure space key is nullprotected booleancanAddPermission(SpacePermission permission)Deprecated.Used by both space and global permission administrators to determine if the user can add the permission.voiddenyAnonymousPermissions(Collection<SpacePermission> currentPermissions, Set<SpacePermission> permissionsToAdd, Set<SpacePermission> permissionsToRemove)Deprecated.intgetNumOfGroupEntries()Deprecated.Returns the number of group entries that are to be added.intgetNumOfUserEntries()Deprecated.Returns the number of user entries that are to be added.booleanisGroupsToAddEmpty(Map requestParams)Deprecated.Validate if the number of groups to add is empty Validation only occurs if the group add button is pressedbooleanisGroupsToAddTooLarge(Map requestParams)Deprecated.Validate if the number of groups to add is greater than maximum allowed.booleanisRemoveAllAdminPermissions(Set<SpacePermission> permissionsToRemove)Deprecated.Returns if all admin permissions would be removed by the request.booleanisUsersToAddEmpty(Map requestParams)Deprecated.Validate if the number of users to add is empty Validation only occurs if the user add button is pressedbooleanisUsersToAddTooLarge(Map requestParams)Deprecated.Validate if the number of users to add is greater than maximum allowed.voidremoveAllPermissions(Set<SpacePermission> permissionsToRemove)Deprecated.Removes the given set of permissions if the current user has permission to do so, otherwise does nothing silently.voidremovePermission(SpacePermission permissionToRemove)Deprecated.Removes the given permission if the current user has permission to do so, otherwise does nothing silently.voidsetGroupsToAdd(List<String> groupsToAdd)Deprecated.Set the groups to add from the UIvoidsetRemoteUser(com.atlassian.user.User remoteUser)Deprecated.The current logged in uservoidsetUsersToAdd(List<String> usersToAdd)Deprecated.Set the users to add from the UIvoidsplitPermissions(Collection<SpacePermission> existingPermissions, Collection<SpacePermission> initialPermissions, Collection<SpacePermission> requestedPermissions, Set<SpacePermission> permissionsToAdd, Set<SpacePermission> permissionsToRemove)Deprecated.Determine which permissions need to be added or removed.-
Methods inherited from class com.atlassian.confluence.security.administrators.DefaultPermissionsAdministrator
buildAnonymousPermissionRow, buildGroupPermissionTable, buildUnlicensedAuthenticatedPermissionRow, 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.EditPermissionsAdministrator
addPermission, buildPermissionsFromWebForm, createGroupGuardPermission, createUserGuardPermission, getAdministrativePermissionType, getInitialPermissionsFromForm, getRequestedPermissionsFromForm
-
Methods inherited from interface com.atlassian.confluence.security.administrators.PermissionsAdministrator
buildAnonymousPermissionRow, buildGroupPermissionTable, buildUnlicensedAuthenticatedPermissionRow, buildUserPermissionTable, getPermissions
-
-
-
-
Field Detail
-
setSpacePermissionChecker
protected final SetSpacePermissionChecker setSpacePermissionChecker
Deprecated.
-
userAccessor
protected final UserAccessor userAccessor
Deprecated.
-
remoteUser
protected com.atlassian.user.User remoteUser
Deprecated.
-
PARAMETER_PREFIX
public static final String PARAMETER_PREFIX
Deprecated.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AbstractEditPermissionsAdministrator
protected AbstractEditPermissionsAdministrator(SpacePermissionManager spacePermissionManager, PermissionResolver permissionResolver, SetSpacePermissionChecker setSpacePermissionChecker, UserAccessor userAccessor)
Deprecated.- Since:
- 5.9
-
-
Method Detail
-
isGroupsToAddTooLarge
public boolean isGroupsToAddTooLarge(Map requestParams)
Deprecated.Validate if the number of groups to add is greater than maximum allowed. Validation only occurs if the group add button is pressed- Specified by:
isGroupsToAddTooLargein interfaceEditPermissionsAdministrator- Parameters:
requestParams- params from the request- Returns:
- true if limit is exceeded.
-
isGroupsToAddEmpty
public boolean isGroupsToAddEmpty(Map requestParams)
Deprecated.Validate if the number of groups to add is empty Validation only occurs if the group add button is pressed- Specified by:
isGroupsToAddEmptyin interfaceEditPermissionsAdministrator- Parameters:
requestParams- params from the request- Returns:
- true if groups are empty
-
getNumOfGroupEntries
public int getNumOfGroupEntries()
Deprecated.Returns the number of group entries that are to be added.- Specified by:
getNumOfGroupEntriesin interfaceEditPermissionsAdministrator- Returns:
- the number of group entries that are to be added
-
isUsersToAddTooLarge
public boolean isUsersToAddTooLarge(Map requestParams)
Deprecated.Validate if the number of users to add is greater than maximum allowed. Validation only occurs if the user add button is pressed- Specified by:
isUsersToAddTooLargein interfaceEditPermissionsAdministrator- Parameters:
requestParams- params from the request- Returns:
- true if limit is exceeded.
-
isUsersToAddEmpty
public boolean isUsersToAddEmpty(Map requestParams)
Deprecated.Validate if the number of users to add is empty Validation only occurs if the user add button is pressed- Specified by:
isUsersToAddEmptyin interfaceEditPermissionsAdministrator- Parameters:
requestParams- params from the request- Returns:
- true if users are empty
-
getNumOfUserEntries
public int getNumOfUserEntries()
Deprecated.Returns the number of user entries that are to be added.- Specified by:
getNumOfUserEntriesin interfaceEditPermissionsAdministrator- Returns:
- the number of user entries that are to be added
-
splitPermissions
public void splitPermissions(Collection<SpacePermission> existingPermissions, Collection<SpacePermission> initialPermissions, Collection<SpacePermission> requestedPermissions, Set<SpacePermission> permissionsToAdd, Set<SpacePermission> permissionsToRemove)
Deprecated.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 collectionspermissionsToAddandpermissionsToRemovewith those permissions that you will need to add or remove to reach the desired state.- Specified by:
splitPermissionsin interfaceEditPermissionsAdministrator- Parameters:
existingPermissions- the currently existing permissionsinitialPermissions- the permissions the user was initially shownrequestedPermissions- the new state we want these permissions to be inpermissionsToAdd- collection into which permissions that need adding will be placedpermissionsToRemove- collection into which permissions that need removing will be placed
-
buildPermissionsFromWebForm
protected Collection<SpacePermission> buildPermissionsFromWebForm(Space space, Map<String,?> formParameters, String parameterQualifier)
Deprecated.Private implementation that doesn't check to ensure space key is null
-
isRemoveAllAdminPermissions
public boolean isRemoveAllAdminPermissions(Set<SpacePermission> permissionsToRemove)
Deprecated.Returns if all admin permissions would be removed by the request.- Specified by:
isRemoveAllAdminPermissionsin interfaceEditPermissionsAdministrator- Parameters:
permissionsToRemove- - permissions to be removed- Returns:
- true if all admin permissions would be removed by the request
-
denyAnonymousPermissions
@Deprecated public void denyAnonymousPermissions(Collection<SpacePermission> currentPermissions, Set<SpacePermission> permissionsToAdd, Set<SpacePermission> permissionsToRemove)
Deprecated.Removes all anonymous permissions- Specified by:
denyAnonymousPermissionsin interfaceEditPermissionsAdministrator- Parameters:
currentPermissions- - current state of the permissionspermissionsToAdd- - permissions to be addedpermissionsToRemove- - permissions to be removed
-
addAllPermissions
public void addAllPermissions(Set<SpacePermission> permissionsToAdd)
Deprecated.Adds the given set of permissions if the current user has permission to do so, otherwise does nothing silently.- Specified by:
addAllPermissionsin interfaceEditPermissionsAdministrator- Parameters:
permissionsToAdd- the set of permissions you want rid of.
-
removeAllPermissions
public void removeAllPermissions(Set<SpacePermission> permissionsToRemove)
Deprecated.Removes the given set of permissions if the current user has permission to do so, otherwise does nothing silently.- Specified by:
removeAllPermissionsin interfaceEditPermissionsAdministrator- Parameters:
permissionsToRemove- the permission you want rid of.
-
canAddPermission
protected boolean canAddPermission(SpacePermission permission)
Deprecated.Used by both space and global permission administrators to determine if the user can add the permission. The criteria to be met are: - User has the right to add the permission - permission does not exist already. - permission is a valid anonymous permission. - permission is a valid "all authenticated users" user permission.- Parameters:
permission- permission to be added- Returns:
- true if the permission can be added.
-
removePermission
public void removePermission(SpacePermission permissionToRemove)
Deprecated.Removes the given permission if the current user has permission to do so, otherwise does nothing silently.- Specified by:
removePermissionin interfaceEditPermissionsAdministrator- Parameters:
permissionToRemove- the permission you want rid of.
-
addGuardPermissionToGroups
public List<String> addGuardPermissionToGroups(List<String> groupNames, String guardPermission)
Deprecated.Description copied from interface:EditPermissionsAdministratorAdd the guard permissions for each group if they exist- Specified by:
addGuardPermissionToGroupsin interfaceEditPermissionsAdministrator- Parameters:
groupNames- - names of the groups to be addedguardPermission- - the name of the guard permission to add- Returns:
- false if an error occurred.
-
addGuardPermissionToUsers
public List<String> addGuardPermissionToUsers(List<String> userNames, String guardPermission)
Deprecated.Description copied from interface:EditPermissionsAdministratorAdd the guard permissions for each user if they exist- Specified by:
addGuardPermissionToUsersin interfaceEditPermissionsAdministrator- Parameters:
userNames- - names of the users to be addedguardPermission- - the name of the guard permission to add- Returns:
- false if an error occurred.
-
addGuardPermissionToUsers
public List<String> addGuardPermissionToUsers(List<String> userNames, UserAccessor userAccessor, String guardPermission)
Deprecated.Add the guard permissions for each user if they exist- Specified by:
addGuardPermissionToUsersin interfaceEditPermissionsAdministrator- Parameters:
userNames- - names of the users to be addeduserAccessor- - user accessorguardPermission- - the name of the guard permission to add- Returns:
- false if an error occurred.
-
addGuardPermissionToGroups
public List<String> addGuardPermissionToGroups(List<String> groupNames, UserAccessor userAccessor, String guardPermission)
Deprecated.Add the guard permissions for each group if they exist- Specified by:
addGuardPermissionToGroupsin interfaceEditPermissionsAdministrator- Parameters:
groupNames- - names of the groups to be addeduserAccessor- - user accessorguardPermission- - the name of the guard permission to add- Returns:
- false if an error occurred.
-
setUsersToAdd
public void setUsersToAdd(List<String> usersToAdd)
Deprecated.Set the users to add from the UI- Parameters:
usersToAdd- a list of user names
-
setGroupsToAdd
public void setGroupsToAdd(List<String> groupsToAdd)
Deprecated.Set the groups to add from the UI- Parameters:
groupsToAdd- a list of group names
-
setRemoteUser
public void setRemoteUser(com.atlassian.user.User remoteUser)
Deprecated.The current logged in user- Parameters:
remoteUser- current logged in user
-
applyPermissionChanges
public void applyPermissionChanges(Collection<SpacePermission> oldPermissions, Collection<SpacePermission> newPermissions) throws IllegalArgumentException
Deprecated.Description copied from interface:EditPermissionsAdministratorGiven the old permissions and new permissions, apply necessary permission changes to make old permissions the same as new permissions- Specified by:
applyPermissionChangesin interfaceEditPermissionsAdministrator- Parameters:
oldPermissions- - initial permissionsnewPermissions- - expected permissions- Throws:
IllegalArgumentException
-
-