@ParametersAreNonnullByDefault public class DefaultSpacePermissionManager extends AbstractSpacePermissionManager
Modifier and Type | Field and Description |
---|---|
protected SpacePermissionDao |
spacePermissionDao |
confluenceAccessManager, permissionCheckExemptions, spacePermissionAccessMapper
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,
com.google.common.base.Supplier<UserAccessor> userAccessor,
AccessModeManager accessModeManager) |
Modifier and Type | Method and Description |
---|---|
void |
createDefaultSpacePermissions(Space space) |
void |
createInitialSpacePermissions(Space space)
Deprecated.
|
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(Space targetSpace,
String permissionType) |
Map<String,Long> |
getGroupsForPermissionType(String permissionType,
Space space) |
Collection<com.atlassian.user.Group> |
getGroupsWithPermissions(Space space)
Returns all groups which have permissions in a space or on a global level.
|
Map<String,Long> |
getUsersForPermissionType(String permissionType,
Space space) |
Collection<com.atlassian.user.User> |
getUsersWithPermissions(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)
Deprecated.
|
void |
removeAllPermissions(Space space,
SpacePermissionContext context)
Removes all permissions belonging to space
|
void |
removeAllPermissionsForGroup(String group)
Deprecated.
|
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 |
removeAllUserPermissions(String username)
Deprecated.
|
void |
removeGlobalPermissionForUser(ConfluenceUser user,
String permissionType)
Deprecated.
|
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)
Deprecated.
|
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)
Deprecated.
|
void |
savePermission(SpacePermission permission,
SpacePermissionContext context)
Saves the permission.
|
protected void |
savePermissionToDao(SpacePermission permission)
Saves the permission to the data store
|
getAccessModeManager, getDefaultGlobalPermissions, getUserAccessor, groupHasPermission, hasAllPermissions, hasGlobalPermissionViaGroups, hasPermission, hasPermission, hasPermissionForSpace, hasPermissionNoExemptions, isPermittedInReadOnlyAccessMode
protected final SpacePermissionDao spacePermissionDao
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, com.google.common.base.Supplier<UserAccessor> userAccessor, AccessModeManager accessModeManager)
public void flushCaches()
@Deprecated 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 save@Deprecated public 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 removal@Deprecated public void removeAllUserPermissions(String username)
username
- the username of the user whose permissions are being removed.@Deprecated public 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 removal@Deprecated public 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)
@Deprecated 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)
@Deprecated public void createInitialSpacePermissions(Space space)
space
- space to set initial space permissions forpublic 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–2018 Atlassian. All rights reserved.