@ParametersAreNonnullByDefault public class ReadOnlySpacePermissionManager extends Object implements SpacePermissionManagerInternal
Constructor and Description |
---|
ReadOnlySpacePermissionManager(SpacePermissionManager spacePermissionManager) |
Modifier and Type | Method and Description |
---|---|
void |
createDefaultSpacePermissions(Space space) |
void |
createPrivateSpacePermissions(Space space) |
void |
flushCaches() |
List<SpacePermission> |
getAllPermissionsForGroup(String arg0) |
Set<SpacePermission> |
getDefaultGlobalPermissions()
Returns the default global permissions that are created when Confluence is set up.
|
List<SpacePermission> |
getGlobalPermissions() |
List<SpacePermission> |
getGlobalPermissions(String arg0) |
Map<String,Long> |
getGroupsForPermissionType(String arg0,
Space arg1) |
Collection<com.atlassian.user.Group> |
getGroupsWithPermissions(@Nullable Space arg0)
Returns all groups which have permissions in a space or on a global level.
|
Map<String,Long> |
getUsersForPermissionType(String arg0,
Space arg1) |
Collection<com.atlassian.user.User> |
getUsersWithPermissions(@Nullable Space arg0)
Returns a collection of user objects with VIEWSPACE_PERMISSION in the space.
|
boolean |
groupHasPermission(String arg0,
@Nullable Space arg1,
String arg2)
Checks whether the given group has the given permission
|
boolean |
hasAllPermissions(List<String> permissionTypes,
@Nullable Space space,
@Nullable com.atlassian.user.User user)
Determines if remoteUser has all of the given permissions in space
|
boolean |
hasPermission(String arg0,
@Nullable Space arg1,
@Nullable com.atlassian.user.User arg2)
Determines if remoteUser has the given permission in space
|
boolean |
hasPermissionForSpace(@Nullable com.atlassian.user.User arg0,
List arg1,
@Nullable Space arg2) |
boolean |
hasPermissionNoExemptions(String permissionType,
@Nullable Space space,
@Nullable com.atlassian.user.User remoteUser)
Returns true if the user has the specified permission on the target space.
|
boolean |
isPermittedInReadOnlyAccessMode(String permissionType)
Check if the permission type is permitted in read only access mode
|
boolean |
permissionExists(SpacePermission arg0)
Check whether the given SpacePermission exists.
|
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.
|
void |
removeAllUserPermissions(@NonNull ConfluenceUser user)
Deprecated.
|
void |
removeAllUserPermissions(ConfluenceUser user,
SpacePermissionContext context)
Removes all permissions for the given user.
|
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.
|
void |
savePermission(SpacePermission permission)
Deprecated.
|
void |
savePermission(SpacePermission permission,
SpacePermissionContext context)
Saves the permission.
|
public ReadOnlySpacePermissionManager(SpacePermissionManager spacePermissionManager)
public void createDefaultSpacePermissions(Space space)
createDefaultSpacePermissions
in interface SpacePermissionManager
public void createPrivateSpacePermissions(Space space)
createPrivateSpacePermissions
in interface SpacePermissionManager
public void flushCaches()
flushCaches
in interface SpacePermissionManager
public List<SpacePermission> getAllPermissionsForGroup(String arg0)
getAllPermissionsForGroup
in interface SpacePermissionManager
public List<SpacePermission> getGlobalPermissions()
getGlobalPermissions
in interface SpacePermissionManager
public List<SpacePermission> getGlobalPermissions(String arg0)
getGlobalPermissions
in interface SpacePermissionManager
public Map<String,Long> getGroupsForPermissionType(String arg0, Space arg1)
getGroupsForPermissionType
in interface SpacePermissionManager
public Collection<com.atlassian.user.Group> getGroupsWithPermissions(@Nullable Space arg0)
SpacePermissionManager
getGroupsWithPermissions
in interface SpacePermissionManager
arg0
- - space to query, if null global permissions returnedpublic Map<String,Long> getUsersForPermissionType(String arg0, Space arg1)
getUsersForPermissionType
in interface SpacePermissionManager
public Collection<com.atlassian.user.User> getUsersWithPermissions(@Nullable Space arg0)
SpacePermissionManager
getUsersWithPermissions
in interface SpacePermissionManager
arg0
- - space to query, if null global permissions returnedpublic boolean groupHasPermission(String arg0, @Nullable Space arg1, String arg2)
SpacePermissionManager
If a null space is specified, this method looks up matching global permissions, otherwise space's permissions list is queried to see if the permission matches.
Similarly, if permissionType is not a space permission, a matching global permission is looked up.
groupHasPermission
in interface SpacePermissionManager
arg0
- The permission type to look uparg1
- The space the permission applies to (can be null for global permissions)arg2
- The group to look up the permission forpublic boolean hasPermission(String arg0, @Nullable Space arg1, @Nullable com.atlassian.user.User arg2)
SpacePermissionManager
Unless you're writing code that is part of the permission checking implementation, or you're changing space permissions,
you should be using PermissionManager
instead.
hasPermission
in interface SpacePermissionManager
arg0
- The permission type to look uparg1
- The space the permission applies to (can be null for global permissions)arg2
- The user to look up (can be null for the anonymous user)public boolean hasPermissionNoExemptions(String permissionType, @Nullable Space space, @Nullable com.atlassian.user.User remoteUser)
SpacePermissionManager
SpacePermissionManager.hasPermission(String, Space, User)
does.
For parameter and return value information, see SpacePermissionManager.hasPermission(String, Space, User)
.
hasPermissionNoExemptions
in interface SpacePermissionManager
public boolean hasAllPermissions(List<String> permissionTypes, @Nullable Space space, @Nullable com.atlassian.user.User user)
SpacePermissionManager
If remoteUser lacks any of the given permissions, false is returned.
Unless you're writing code that is part of the permission checking implementation, or you're changing space permissions,
you should be using PermissionManager
instead.
hasAllPermissions
in interface SpacePermissionManager
permissionTypes
- A List of permission types (see SpacePermission) to checkspace
- The space the permissions apply touser
- The user to look uppublic boolean hasPermissionForSpace(@Nullable com.atlassian.user.User arg0, List arg1, @Nullable Space arg2)
hasPermissionForSpace
in interface SpacePermissionManager
public boolean permissionExists(SpacePermission arg0)
SpacePermissionManager
permissionExists
in interface SpacePermissionManager
arg0
- the permission to look for.public Set<SpacePermission> getDefaultGlobalPermissions()
SpacePermissionManager
By default, confluence-administrators group has admin access, the default confluence users group can view the system and anonymous access is disabled.
getDefaultGlobalPermissions
in interface SpacePermissionManager
SpacePermission
s.public boolean isPermittedInReadOnlyAccessMode(String permissionType)
SpacePermissionManager
isPermittedInReadOnlyAccessMode
in interface SpacePermissionManager
permissionType
- the permission type to be checked@Deprecated public void removeAllPermissions(Space space)
SpacePermissionManager
removeAllPermissions
in interface SpacePermissionManager
space
- The space to remove the permissions forpublic void removeAllPermissions(Space space, SpacePermissionContext context)
SpacePermissionManagerInternal
removeAllPermissions
in interface SpacePermissionManagerInternal
space
- The space to remove the permissions forcontext
- The context for this removal@Deprecated public void removeAllPermissionsForGroup(String group)
SpacePermissionManager
SpacePermissionsRemoveForGroupEvent
in the process.removeAllPermissionsForGroup
in interface SpacePermissionManager
group
- the group to removepublic void removeAllPermissionsForGroup(String group, SpacePermissionContext context)
SpacePermissionManagerInternal
May generate a SpacePermissionsRemoveForGroupEvent
in
the process, depending on the context.
removeAllPermissionsForGroup
in interface SpacePermissionManagerInternal
group
- the group to remove@Deprecated public void removeAllUserPermissions(@NonNull ConfluenceUser user)
SpacePermissionManager
SpacePermissionsRemoveForUserEvent
in the process.removeAllUserPermissions
in interface SpacePermissionManager
public void removeAllUserPermissions(ConfluenceUser user, SpacePermissionContext context)
SpacePermissionManagerInternal
May generate a SpacePermissionsRemoveForUserEvent
in the
process, depending on the context.
removeAllUserPermissions
in interface SpacePermissionManagerInternal
user
- the user to remove permissions forcontext
- the context for the removal@Deprecated public void removeGlobalPermissionForUser(ConfluenceUser user, String permissionType)
SpacePermissionManager
SpacePermissionsRemoveForUserEvent
in the process.removeGlobalPermissionForUser
in interface SpacePermissionManager
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.
removeGlobalPermissionForUser
in interface SpacePermissionManagerInternal
user
- the user to look uppermissionType
- the permission type to removecontext
- the context for the removal@Deprecated public void removePermission(SpacePermission permission)
SpacePermissionManager
SpacePermissionRemoveEvent
in the process.removePermission
in interface SpacePermissionManager
permission
- the permission to removepublic void removePermission(SpacePermission permission, SpacePermissionContext context)
SpacePermissionManagerInternal
May generate a SpacePermissionRemoveEvent
in the process,
depending on the context.
removePermission
in interface SpacePermissionManagerInternal
permission
- the permission to removecontext
- the context for the removal@Deprecated public void savePermission(SpacePermission permission)
SpacePermissionSaver
SpacePermissionSaveEvent
in the process.savePermission
in interface SpacePermissionSaver
public void savePermission(SpacePermission permission, SpacePermissionContext context)
SpacePermissionSaverInternal
May generate a SpacePermissionSaveEvent
in the process,
depending on the context.
savePermission
in interface SpacePermissionSaverInternal
permission
- the permission to savecontext
- the context for the saveCopyright © 2003–2020 Atlassian. All rights reserved.