|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface EditPermissionsAdministrator
Provides the logic required by the actions to edit the permissions for both global and spaces
Field Summary | |
---|---|
static java.lang.Integer |
MAX_ENTRIES
the max number of entries for adding groups or users to permission scheme. |
Method Summary | |
---|---|
void |
addAllPermissions(java.util.Set<SpacePermission> permissionsToAdd)
Adds the given set of permissions if the current user has permission to do so, otherwise does nothing silently. |
java.util.List<java.lang.String> |
addGuardPermissionToGroups(java.util.List<java.lang.String> groupNames,
UserAccessor userAccessor,
java.lang.String guardPermission)
Add the guard permissions for each group if they exist |
java.util.List<java.lang.String> |
addGuardPermissionToUsers(java.util.List<java.lang.String> userNames,
UserAccessor userAccessor,
java.lang.String guardPermission)
Add the guard permissions for each user if they exist |
void |
addPermission(SpacePermission permissionToAdd)
Adds the given permission if the current user has permission to do so, otherwise does nothing silently. |
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 |
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 |
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. since 5.2. See createUserGuardPermission(String, ConfluenceUser) |
void |
denyAnonymousPermissions(java.util.Collection<SpacePermission> currentPermissions,
java.util.Set<SpacePermission> permissionsToAdd,
java.util.Set<SpacePermission> permissionsToRemove)
Removes all anonymous permissions |
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 |
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. |
java.util.Collection<SpacePermission> |
getRequestedPermissionsFromForm(java.util.Map requestParams)
Retrieve the state of the permissions requested by the user |
boolean |
isGroupsToAddEmpty(java.util.Map requestParams)
Validate if the number of groups to add is empty Validation only occurs if the group add button is pressed |
boolean |
isGroupsToAddTooLarge(java.util.Map requestParams)
Validate if the number of groups to add is greater than maximum allowed. |
boolean |
isRemoveAllAdminPermissions(java.util.Set<SpacePermission> permissionsToRemove)
Returns if all admin permissions would be removed by the request. |
boolean |
isUsersToAddEmpty(java.util.Map requestParams)
Validate if the number of users to add is empty Validation only occurs if the user add button is pressed |
boolean |
isUsersToAddTooLarge(java.util.Map requestParams)
Validate if the number of users to add is greater than maximum allowed. |
void |
removeAllPermissions(java.util.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 |
splitPermissions(java.util.Collection<SpacePermission> existingPermissions,
java.util.Collection<SpacePermission> initialPermissions,
java.util.Collection<SpacePermission> requestedPermissions,
java.util.Set<SpacePermission> permissionsToAdd,
java.util.Set<SpacePermission> permissionsToRemove)
Determine which permissions need to be added or removed. |
Methods inherited from interface com.atlassian.confluence.security.administrators.PermissionsAdministrator |
---|
buildAnonymousPermissionRow, buildGroupPermissionTable, buildUserPermissionTable, getPermissions |
Field Detail |
---|
static final java.lang.Integer MAX_ENTRIES
Method Detail |
---|
boolean isGroupsToAddTooLarge(java.util.Map requestParams)
requestParams
- params from the request
boolean isGroupsToAddEmpty(java.util.Map requestParams)
requestParams
- params from the request
int getNumOfGroupEntries()
boolean isUsersToAddTooLarge(java.util.Map requestParams)
requestParams
- params from the request
boolean isUsersToAddEmpty(java.util.Map requestParams)
requestParams
- params from the request
int getNumOfUserEntries()
java.util.Collection<SpacePermission> buildPermissionsFromWebForm(java.util.Map formParameters, java.lang.String parameterQualifier)
formParameters
- the map of form parametersparameterQualifier
- distinguishes the set of parameters from other sets of parameters used to represent
permissions in the same form.
void splitPermissions(java.util.Collection<SpacePermission> existingPermissions, java.util.Collection<SpacePermission> initialPermissions, java.util.Collection<SpacePermission> requestedPermissions, java.util.Set<SpacePermission> permissionsToAdd, java.util.Set<SpacePermission> permissionsToRemove)
permissionsToAdd
and permissionsToRemove
with those permissions that
you will need to add or remove to reach the desired state.
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 placedboolean isRemoveAllAdminPermissions(java.util.Set<SpacePermission> permissionsToRemove)
permissionsToRemove
- - permissions to be removed
java.util.Collection<SpacePermission> getInitialPermissionsFromForm(java.util.Map requestParams)
java.util.Collection<SpacePermission> getRequestedPermissionsFromForm(java.util.Map requestParams)
void denyAnonymousPermissions(java.util.Collection<SpacePermission> currentPermissions, java.util.Set<SpacePermission> permissionsToAdd, java.util.Set<SpacePermission> permissionsToRemove)
currentPermissions
- - current state of the permissionspermissionsToAdd
- - permissions to be addedpermissionsToRemove
- - permissions to be removedvoid addAllPermissions(java.util.Set<SpacePermission> permissionsToAdd)
permissionsToAdd
- the set of permissions you want rid of.void addPermission(SpacePermission permissionToAdd)
permissionToAdd
- the permission you want rid of.void removeAllPermissions(java.util.Set<SpacePermission> permissionsToRemove)
permissionsToRemove
- the permission you want rid of.void removePermission(SpacePermission permissionToRemove)
permissionToRemove
- the permission you want rid of.java.util.List<java.lang.String> addGuardPermissionToGroups(java.util.List<java.lang.String> groupNames, UserAccessor userAccessor, java.lang.String guardPermission)
groupNames
- - names of the groups to be addeduserAccessor
- - user accessorguardPermission
- - the name of the guard permission to add
java.util.List<java.lang.String> addGuardPermissionToUsers(java.util.List<java.lang.String> userNames, UserAccessor userAccessor, java.lang.String guardPermission)
userNames
- - names of the users to be addeduserAccessor
- - user accessorguardPermission
- - the name of the guard permission to add
@Deprecated SpacePermission createUserGuardPermission(java.lang.String guardPermission, java.lang.String userName)
createUserGuardPermission(String, ConfluenceUser)
guardPermission
- - the name of the guard permission to createuserName
- - name of the user to add the permission to
SpacePermission createUserGuardPermission(java.lang.String guardPermission, ConfluenceUser user)
guardPermission
- - the name of the guard permission to createuser
- - name of the user to add the permission to
SpacePermission createGroupGuardPermission(java.lang.String guardPermission, java.lang.String groupName)
guardPermission
- - the name of the guard permission to creategroupName
- - name of group to add the permission to
java.lang.String getAdministrativePermissionType()
void applyPermissionChanges(java.util.Collection<SpacePermission> oldPermissions, java.util.Collection<SpacePermission> newPermissions)
oldPermissions
- - initial permissionsnewPermissions
- - expected permissions
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |