@ParametersAreNonnullByDefault public class DefaultSpacePermissionManager extends AbstractSpacePermissionManager
Modifier | Constructor and Description |
---|---|
protected |
DefaultSpacePermissionManager(SpacePermissionDao spacePermissionDao,
PermissionCheckExemptions permissionCheckExemptions,
SpacePermissionDefaultsStoreFactory spacePermissionDefaultsStoreFactory,
com.atlassian.event.api.EventPublisher eventPublisher,
ConfluenceAccessManager confluenceAccessManager,
SpacePermissionAccessMapper spacePermissionAccessMapper,
com.atlassian.crowd.embedded.api.CrowdService crowdService,
ConfluenceUserResolver userResolver,
AccessModeManager accessModeManager,
ScopesRequestCacheDelegate scopesRequestCacheDelegate,
GlobalSettingsManager settingsManager,
GroupResolver groupResolver) |
Modifier and Type | Method and Description |
---|---|
void |
createDefaultSpacePermissions(Space space) |
void |
createPrivateSpacePermissions(Space space) |
void |
flushCaches() |
List<SpacePermission> |
getAllPermissionsForGroup(String group) |
protected List<SpacePermission> |
getAllPermissionsForUser(ConfluenceUser user) |
List<SpacePermission> |
getGlobalPermissions() |
List<SpacePermission> |
getGlobalPermissions(String permissionType) |
protected Set<String> |
getGroupNamesWithPermission(@Nullable Space targetSpace,
String permissionType) |
Map<String,Long> |
getGroupsForPermissionType(String permissionType,
@Nullable Space space) |
Collection<com.atlassian.user.Group> |
getGroupsWithPermissions(@Nullable Space space)
Returns all groups which have permissions in a space or on a global level.
|
Map<String,Long> |
getUsersForPermissionType(String permissionType,
@Nullable Space space) |
Collection<com.atlassian.user.User> |
getUsersWithPermissions(@Nullable Space space)
Returns a collection of user objects with VIEWSPACE_PERMISSION in the space.
|
boolean |
permissionExists(SpacePermission permission)
Determines if permission exists in the SpacePermissionDao
|
void |
removeAllPermissions(Space space)
Removes all permissions belonging to space
|
void |
removeAllPermissions(Space space,
SpacePermissionContext context)
Removes all permissions belonging to space
|
void |
removeAllPermissionsForGroup(String group)
Removes all permissions for the given group, and generates a
SpacePermissionsRemoveForGroupEvent in the process. |
void |
removeAllPermissionsForGroup(String group,
SpacePermissionContext context)
Removes all permissions for the given group.
|
protected void |
removeAllPermissionsFromDao(Space space) |
void |
removeAllUserPermissions(ConfluenceUser user)
Removes all permissions for the given user, and generates a
SpacePermissionsRemoveForUserEvent in the process. |
void |
removeAllUserPermissions(ConfluenceUser user,
SpacePermissionContext context)
Removes all permissions for the given user.
|
void |
removeGlobalPermissionForUser(ConfluenceUser user,
String permissionType)
Removes global permission of specified type that is directly associated with a user, and generates a
SpacePermissionsRemoveForUserEvent in the process. |
void |
removeGlobalPermissionForUser(ConfluenceUser user,
String permissionType,
SpacePermissionContext context)
Removes global permission of specified type that is directly associated with a user.
|
void |
removePermission(SpacePermission permission)
Removes the specified permission.
|
void |
removePermission(SpacePermission permission,
SpacePermissionContext context)
Removes the given permission.
|
protected void |
removePermissionFromDao(SpacePermission realPermission)
Removes the permission from the data store
|
void |
savePermission(SpacePermission permission)
Saves the permission, and generates a
SpacePermissionSaveEvent in the process. |
void |
savePermission(SpacePermission permission,
SpacePermissionContext context)
Saves the permission.
|
protected void |
savePermissionToDao(SpacePermission permission)
Saves the permission to the data store
|
getDefaultGlobalPermissions, groupHasPermission, hasAllPermissions, hasGlobalPermissionViaGroups, hasPermission, hasPermissionForSpace, hasPermissionNoExemptions, isPermittedInReadOnlyAccessMode
protected DefaultSpacePermissionManager(SpacePermissionDao spacePermissionDao, PermissionCheckExemptions permissionCheckExemptions, SpacePermissionDefaultsStoreFactory spacePermissionDefaultsStoreFactory, com.atlassian.event.api.EventPublisher eventPublisher, ConfluenceAccessManager confluenceAccessManager, SpacePermissionAccessMapper spacePermissionAccessMapper, com.atlassian.crowd.embedded.api.CrowdService crowdService, ConfluenceUserResolver userResolver, AccessModeManager accessModeManager, ScopesRequestCacheDelegate scopesRequestCacheDelegate, GlobalSettingsManager settingsManager, GroupResolver groupResolver)
public void flushCaches()
public void savePermission(SpacePermission permission)
SpacePermissionSaver
SpacePermissionSaveEvent
in the process.IllegalArgumentException
- if the permission is a disallowed anonymous permission (CONF-4155)public void savePermission(SpacePermission permission, SpacePermissionContext context)
SpacePermissionSaverInternal
May generate a SpacePermissionSaveEvent
in the process,
depending on the context.
permission
- the permission to savecontext
- the context for the savepublic void removePermission(SpacePermission permission)
permission
- the permission to removepublic void removePermission(SpacePermission permission, SpacePermissionContext context)
SpacePermissionManagerInternal
May generate a SpacePermissionRemoveEvent
in the process,
depending on the context.
permission
- the permission to removecontext
- the context for the removalpublic List<SpacePermission> getGlobalPermissions()
public List<SpacePermission> getGlobalPermissions(String permissionType)
public void removeAllUserPermissions(ConfluenceUser user)
SpacePermissionManager
SpacePermissionsRemoveForUserEvent
in the process.public void removeAllUserPermissions(ConfluenceUser user, SpacePermissionContext context)
SpacePermissionManagerInternal
May generate a SpacePermissionsRemoveForUserEvent
in the
process, depending on the context.
user
- the user to remove permissions forcontext
- the context for the removalpublic void removeGlobalPermissionForUser(ConfluenceUser user, String permissionType)
SpacePermissionManager
SpacePermissionsRemoveForUserEvent
in the process.user
- the user to look uppermissionType
- the permission type to removepublic void removeGlobalPermissionForUser(ConfluenceUser user, String permissionType, SpacePermissionContext context)
SpacePermissionManagerInternal
May generate a SpacePermissionsRemoveForUserEvent
in the
process, depending on the context.
user
- the user to look uppermissionType
- the permission type to removecontext
- the context for the removalpublic void removeAllPermissionsForGroup(String group)
SpacePermissionManager
SpacePermissionsRemoveForGroupEvent
in the process.group
- the group to removepublic void removeAllPermissionsForGroup(String group, SpacePermissionContext context)
SpacePermissionManagerInternal
May generate a SpacePermissionsRemoveForGroupEvent
in
the process, depending on the context.
group
- the group to removepublic List<SpacePermission> getAllPermissionsForGroup(String group)
protected List<SpacePermission> getAllPermissionsForUser(ConfluenceUser user)
public void removeAllPermissions(Space space)
SpacePermissionManager
space
- The space to remove the permissions forpublic void removeAllPermissions(Space space, SpacePermissionContext context)
SpacePermissionManagerInternal
space
- The space to remove the permissions forcontext
- The context for this removalprotected void removeAllPermissionsFromDao(Space space)
public void createPrivateSpacePermissions(Space space)
public void createDefaultSpacePermissions(Space space)
public Collection<com.atlassian.user.User> getUsersWithPermissions(@Nullable Space space)
SpacePermissionManager
space
- - space to query, if null global permissions returnedpublic Collection<com.atlassian.user.Group> getGroupsWithPermissions(@Nullable Space space)
SpacePermissionManager
space
- - space to query, if null global permissions returnedpublic Map<String,Long> getUsersForPermissionType(String permissionType, @Nullable Space space)
public Map<String,Long> getGroupsForPermissionType(String permissionType, @Nullable Space space)
String
groupNames and values that are Long
Group
permissionId. The keys in the Map are not case sensitive.protected Set<String> getGroupNamesWithPermission(@Nullable Space targetSpace, String permissionType)
getGroupNamesWithPermission
in class AbstractSpacePermissionManager
public boolean permissionExists(SpacePermission permission)
permission
- The SpacePermission object to look upprotected void savePermissionToDao(SpacePermission permission)
This may be overridden to provide caching, where applicable.
permission
- the SpacePermission to be savedprotected void removePermissionFromDao(SpacePermission realPermission)
This may be overridden to provide caching, where applicable
realPermission
- the SpacePermission to be removedCopyright © 2003–2023 Atlassian. All rights reserved.
View cookie preferences