public abstract class AbstractEditPermissionsAdministrator extends DefaultPermissionsAdministrator implements EditPermissionsAdministrator
DefaultPermissionsAdministrator.GroupPermissionRow, DefaultPermissionsAdministrator.UnlicensedPermissionRow, DefaultPermissionsAdministrator.UserPermissionRow
Modifier and Type | Field and Description |
---|---|
static String |
PARAMETER_PREFIX |
protected com.atlassian.user.User |
remoteUser |
protected SearchEntitiesManager |
searchEntitiesManager
Deprecated.
since 5.9. No longer used.
|
protected SetSpacePermissionChecker |
setSpacePermissionChecker |
protected UserAccessor |
userAccessor |
permissions, spacePermissionManager
MAX_ENTRIES
Modifier | Constructor and Description |
---|---|
protected |
AbstractEditPermissionsAdministrator(SpacePermissionManager spacePermissionManager,
PermissionResolver permissionResolver,
SetSpacePermissionChecker setSpacePermissionChecker,
SearchEntitiesManager searchEntitiesManager)
|
protected |
AbstractEditPermissionsAdministrator(SpacePermissionManager spacePermissionManager,
PermissionResolver permissionResolver,
SetSpacePermissionChecker setSpacePermissionChecker,
SearchEntitiesManager searchEntitiesManager,
SettingsManager settingsManager)
|
protected |
AbstractEditPermissionsAdministrator(SpacePermissionManager spacePermissionManager,
PermissionResolver permissionResolver,
SetSpacePermissionChecker setSpacePermissionChecker,
SearchEntitiesManager searchEntitiesManager,
UserAccessor userAccessor)
|
protected |
AbstractEditPermissionsAdministrator(SpacePermissionManager spacePermissionManager,
PermissionResolver permissionResolver,
SetSpacePermissionChecker setSpacePermissionChecker,
UserAccessor userAccessor) |
Modifier and Type | Method and Description |
---|---|
void |
addAllPermissions(Set<SpacePermission> permissionsToAdd)
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)
Add the guard permissions for each group if they exist
|
List<String> |
addGuardPermissionToUsers(List<String> userNames,
UserAccessor userAccessor,
String guardPermission)
Add the guard permissions for each user if they exist
|
void |
applyPermissionChanges(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
|
protected Collection<SpacePermission> |
buildPermissionsFromWebForm(Space space,
Map<String,?> formParameters,
String parameterQualifier)
Private implementation that doesn't check to ensure space key is null
|
protected boolean |
canAddPermission(SpacePermission permission)
Used by both space and global permission administrators to
determine if the user can add the permission.
|
void |
denyAnonymousPermissions(Collection<SpacePermission> currentPermissions,
Set<SpacePermission> permissionsToAdd,
Set<SpacePermission> permissionsToRemove)
Deprecated.
|
int |
getNumOfGroupEntries()
Returns the number of group entries that are to be added.
|
int |
getNumOfUserEntries()
Returns the number of user entries that are to be added.
|
boolean |
isGroupsToAddEmpty(Map requestParams)
Validate if the number of groups to add is empty
Validation only occurs if the group add button is pressed
|
boolean |
isGroupsToAddTooLarge(Map requestParams)
Validate if the number of groups to add is greater
than maximum allowed.
|
boolean |
isRemoveAllAdminPermissions(Set<SpacePermission> permissionsToRemove)
Returns if all admin permissions would be removed by
the request.
|
boolean |
isUsersToAddEmpty(Map requestParams)
Validate if the number of users to add is empty
Validation only occurs if the user add button is pressed
|
boolean |
isUsersToAddTooLarge(Map requestParams)
Validate if the number of users to add is greater
than maximum allowed.
|
void |
removeAllPermissions(Set<SpacePermission> permissionsToRemove)
Removes the given set of permissions if the current user has permission to do so, otherwise does nothing silently.
|
void |
removePermission(SpacePermission permissionToRemove)
Removes the given permission if the current user has permission to do so, otherwise does nothing silently.
|
void |
setGroupsToAdd(List<String> groupsToAdd)
Set the groups to add from the UI
|
void |
setRemoteUser(com.atlassian.user.User remoteUser)
The current logged in user
|
void |
setUsersToAdd(List<String> usersToAdd)
Set the users to add from the UI
|
void |
splitPermissions(Collection<SpacePermission> existingPermissions,
Collection<SpacePermission> initialPermissions,
Collection<SpacePermission> requestedPermissions,
Set<SpacePermission> permissionsToAdd,
Set<SpacePermission> permissionsToRemove)
Determine which permissions need to be added or removed.
|
buildAnonymousPermissionRow, buildGroupPermissionTable, buildUnlicensedAuthenticatedPermissionRow, buildUserPermissionTable, getPermissions, resetPermissions
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addPermission, buildPermissionsFromWebForm, createGroupGuardPermission, createUserGuardPermission, createUserGuardPermission, getAdministrativePermissionType, getInitialPermissionsFromForm, getRequestedPermissionsFromForm
buildAnonymousPermissionRow, buildGroupPermissionTable, buildUnlicensedAuthenticatedPermissionRow, buildUserPermissionTable, getPermissions
protected final SetSpacePermissionChecker setSpacePermissionChecker
@Deprecated protected final SearchEntitiesManager searchEntitiesManager
protected final UserAccessor userAccessor
protected com.atlassian.user.User remoteUser
public static final String PARAMETER_PREFIX
@Deprecated protected AbstractEditPermissionsAdministrator(SpacePermissionManager spacePermissionManager, PermissionResolver permissionResolver, SetSpacePermissionChecker setSpacePermissionChecker, SearchEntitiesManager searchEntitiesManager, SettingsManager settingsManager)
@Deprecated protected AbstractEditPermissionsAdministrator(SpacePermissionManager spacePermissionManager, PermissionResolver permissionResolver, SetSpacePermissionChecker setSpacePermissionChecker, SearchEntitiesManager searchEntitiesManager)
@Deprecated protected AbstractEditPermissionsAdministrator(SpacePermissionManager spacePermissionManager, PermissionResolver permissionResolver, SetSpacePermissionChecker setSpacePermissionChecker, SearchEntitiesManager searchEntitiesManager, UserAccessor userAccessor)
protected AbstractEditPermissionsAdministrator(SpacePermissionManager spacePermissionManager, PermissionResolver permissionResolver, SetSpacePermissionChecker setSpacePermissionChecker, UserAccessor userAccessor)
public boolean isGroupsToAddTooLarge(Map requestParams)
isGroupsToAddTooLarge
in interface EditPermissionsAdministrator
requestParams
- params from the requestpublic boolean isGroupsToAddEmpty(Map requestParams)
isGroupsToAddEmpty
in interface EditPermissionsAdministrator
requestParams
- params from the requestpublic int getNumOfGroupEntries()
getNumOfGroupEntries
in interface EditPermissionsAdministrator
public boolean isUsersToAddTooLarge(Map requestParams)
isUsersToAddTooLarge
in interface EditPermissionsAdministrator
requestParams
- params from the requestpublic boolean isUsersToAddEmpty(Map requestParams)
isUsersToAddEmpty
in interface EditPermissionsAdministrator
requestParams
- params from the requestpublic int getNumOfUserEntries()
getNumOfUserEntries
in interface EditPermissionsAdministrator
public void splitPermissions(Collection<SpacePermission> existingPermissions, Collection<SpacePermission> initialPermissions, Collection<SpacePermission> requestedPermissions, Set<SpacePermission> permissionsToAdd, Set<SpacePermission> permissionsToRemove)
permissionsToAdd
and permissionsToRemove
with those permissions that
you will need to add or remove to reach the desired state.splitPermissions
in interface EditPermissionsAdministrator
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 placedprotected Collection<SpacePermission> buildPermissionsFromWebForm(Space space, Map<String,?> formParameters, String parameterQualifier)
public boolean isRemoveAllAdminPermissions(Set<SpacePermission> permissionsToRemove)
isRemoveAllAdminPermissions
in interface EditPermissionsAdministrator
permissionsToRemove
- - permissions to be removed@Deprecated public void denyAnonymousPermissions(Collection<SpacePermission> currentPermissions, Set<SpacePermission> permissionsToAdd, Set<SpacePermission> permissionsToRemove)
denyAnonymousPermissions
in interface EditPermissionsAdministrator
currentPermissions
- - current state of the permissionspermissionsToAdd
- - permissions to be addedpermissionsToRemove
- - permissions to be removedpublic void addAllPermissions(Set<SpacePermission> permissionsToAdd)
addAllPermissions
in interface EditPermissionsAdministrator
permissionsToAdd
- the set of permissions you want rid of.public void removeAllPermissions(Set<SpacePermission> permissionsToRemove)
removeAllPermissions
in interface EditPermissionsAdministrator
permissionsToRemove
- the permission you want rid of.protected boolean canAddPermission(SpacePermission permission)
permission
- permission to be addedpublic void removePermission(SpacePermission permissionToRemove)
removePermission
in interface EditPermissionsAdministrator
permissionToRemove
- the permission you want rid of.public List<String> addGuardPermissionToUsers(List<String> userNames, UserAccessor userAccessor, String guardPermission)
addGuardPermissionToUsers
in interface EditPermissionsAdministrator
userNames
- - names of the users to be addeduserAccessor
- - user accessorguardPermission
- - the name of the guard permission to addpublic List<String> addGuardPermissionToGroups(List<String> groupNames, UserAccessor userAccessor, String guardPermission)
addGuardPermissionToGroups
in interface EditPermissionsAdministrator
groupNames
- - names of the groups to be addeduserAccessor
- - user accessorguardPermission
- - the name of the guard permission to addpublic void setUsersToAdd(List<String> usersToAdd)
usersToAdd
- a list of user namespublic void setGroupsToAdd(List<String> groupsToAdd)
groupsToAdd
- a list of group namespublic void setRemoteUser(com.atlassian.user.User remoteUser)
remoteUser
- current logged in userpublic void applyPermissionChanges(Collection<SpacePermission> oldPermissions, Collection<SpacePermission> newPermissions) throws IllegalArgumentException
EditPermissionsAdministrator
applyPermissionChanges
in interface EditPermissionsAdministrator
oldPermissions
- - initial permissionsnewPermissions
- - expected permissionsIllegalArgumentException
Copyright © 2003–2017 Atlassian. All rights reserved.