com.atlassian.confluence.security
Class ReadOnlySpacePermissionManager

java.lang.Object
  extended by com.atlassian.confluence.security.ReadOnlySpacePermissionManager
All Implemented Interfaces:
SpacePermissionManager, SpacePermissionSaver

public class ReadOnlySpacePermissionManager
extends java.lang.Object
implements SpacePermissionManager


Constructor Summary
ReadOnlySpacePermissionManager(SpacePermissionManager spacePermissionManager)
           
 
Method Summary
 void createDefaultSpacePermissions(Space space)
           
 void createInitialSpacePermissions(Space arg0)
          Creates all the initial permissions (in this list SpacePermission.GENERIC_SPACE_PERMISSIONS) in the specified space.
 void createPrivateSpacePermissions(Space space)
           
 void flushCaches()
           
 java.util.List<SpacePermission> getAllPermissionsForGroup(java.lang.String arg0)
           
 java.util.Set<SpacePermission> getDefaultGlobalPermissions()
          Returns the default global permissions that are created when Confluence is set up.
 java.util.List<SpacePermission> getGlobalPermissions()
           
 java.util.List<SpacePermission> getGlobalPermissions(java.lang.String arg0)
           
 java.util.Map getGroupsForPermissionType(java.lang.String arg0, Space arg1)
           
 java.util.Collection getGroupsWithPermissions(Space arg0)
          Returns all groups wich have permissions in a space or on a global level.
 java.util.Map getUsersForPermissionType(java.lang.String arg0, Space arg1)
           
 java.util.Collection getUsersWithPermissions(Space arg0)
          Returns a collection of user objects with VIEWSPACE_PERMISSION in the space.
 boolean groupHasPermission(java.lang.String arg0, Space arg1, java.lang.String arg2)
          Checks whether the given group has the given permission

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.

 boolean hasAllPermissions(java.util.List<java.lang.String> permissionTypes, Space space, com.atlassian.user.User user)
          Determines if remoteUser has all of the given permissions in space

If remoteUser lacks any of the given permissions, false is returned.

 boolean hasPermission(java.util.List arg0, Space arg1, com.atlassian.user.User arg2)
          Determines if remoteUser has the given permissions in space

If remoteUser lacks any of the given permissions, false is returned.

 boolean hasPermission(java.lang.String arg0, Space arg1, com.atlassian.user.User arg2)
          Determines if remoteUser has the given permission in space 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.
 boolean hasPermissionForSpace(com.atlassian.user.User arg0, java.util.List arg1, Space arg2)
           
 boolean permissionExists(SpacePermission arg0)
          Check whether the given SpacePermission exists.
 void removeAllPermissions(Space arg0)
          Removes all permissions belonging to space
 void removeAllPermissionsForGroup(java.lang.String arg0)
           
 void removeAllUserPermissions(ConfluenceUser user)
           
 void removeAllUserPermissions(java.lang.String arg0)
          Deprecated. 
 void removeGlobalPermissionForUser(ConfluenceUser user, java.lang.String permissionType)
          Removes global permission of specified type that is directly associated with a user
 void removePermission(SpacePermission arg0)
           
 void savePermission(SpacePermission arg0)
          Saves the permission.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReadOnlySpacePermissionManager

public ReadOnlySpacePermissionManager(SpacePermissionManager spacePermissionManager)
Method Detail

createInitialSpacePermissions

public void createInitialSpacePermissions(Space arg0)
Description copied from interface: SpacePermissionManager
Creates all the initial permissions (in this list SpacePermission.GENERIC_SPACE_PERMISSIONS) in the specified space.

Specified by:
createInitialSpacePermissions in interface SpacePermissionManager

createDefaultSpacePermissions

public void createDefaultSpacePermissions(Space space)
Specified by:
createDefaultSpacePermissions in interface SpacePermissionManager

createPrivateSpacePermissions

public void createPrivateSpacePermissions(Space space)
Specified by:
createPrivateSpacePermissions in interface SpacePermissionManager

flushCaches

public void flushCaches()
Specified by:
flushCaches in interface SpacePermissionManager

getAllPermissionsForGroup

public java.util.List<SpacePermission> getAllPermissionsForGroup(java.lang.String arg0)
Specified by:
getAllPermissionsForGroup in interface SpacePermissionManager

getGlobalPermissions

public java.util.List<SpacePermission> getGlobalPermissions()
Specified by:
getGlobalPermissions in interface SpacePermissionManager

getGlobalPermissions

public java.util.List<SpacePermission> getGlobalPermissions(java.lang.String arg0)
Specified by:
getGlobalPermissions in interface SpacePermissionManager

getGroupsForPermissionType

public java.util.Map getGroupsForPermissionType(java.lang.String arg0,
                                                Space arg1)
Specified by:
getGroupsForPermissionType in interface SpacePermissionManager

getGroupsWithPermissions

public java.util.Collection getGroupsWithPermissions(Space arg0)
Description copied from interface: SpacePermissionManager
Returns all groups wich have permissions in a space or on a global level. If space is null, permissions on the global level will be checked.

Specified by:
getGroupsWithPermissions in interface SpacePermissionManager
Parameters:
arg0 - - space to query, if null global permissions returned
Returns:
Collection of groups with permissions

getUsersForPermissionType

public java.util.Map getUsersForPermissionType(java.lang.String arg0,
                                               Space arg1)
Specified by:
getUsersForPermissionType in interface SpacePermissionManager

getUsersWithPermissions

public java.util.Collection getUsersWithPermissions(Space arg0)
Description copied from interface: SpacePermissionManager
Returns a collection of user objects with VIEWSPACE_PERMISSION in the space. If no space is provided A list of users with USE_CONFLUENCE_PERMISSION will be returned

Specified by:
getUsersWithPermissions in interface SpacePermissionManager
Parameters:
arg0 - - space to query, if null global permissions returned
Returns:
Collection of User objects

groupHasPermission

public boolean groupHasPermission(java.lang.String arg0,
                                  Space arg1,
                                  java.lang.String arg2)
Description copied from interface: SpacePermissionManager
Checks whether the given group has the given permission

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.

Specified by:
groupHasPermission in interface SpacePermissionManager
Parameters:
arg0 - The permission type to look up
arg1 - The space the permission applies to (can be null for global permissions)
arg2 - The group to look up the permission for
Returns:
true if the group has the required permission, false otherwise

hasPermission

public boolean hasPermission(java.lang.String arg0,
                             Space arg1,
                             com.atlassian.user.User arg2)
Description copied from interface: SpacePermissionManager
Determines if remoteUser has the given permission in space 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.

Specified by:
hasPermission in interface SpacePermissionManager
Parameters:
arg0 - The permission type to look up
arg1 - 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)
Returns:
true if remoteUser has the permission, false otherwise

hasPermission

public boolean hasPermission(java.util.List arg0,
                             Space arg1,
                             com.atlassian.user.User arg2)
Description copied from interface: SpacePermissionManager
Determines if remoteUser has the given permissions in space

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.

Specified by:
hasPermission in interface SpacePermissionManager
Parameters:
arg0 - A List of permission types (see SpacePermission) to check
arg1 - The space the permissions apply to
arg2 - The user to look up
Returns:
true if remoteUser has the permission, false otherwise

hasAllPermissions

public boolean hasAllPermissions(java.util.List<java.lang.String> permissionTypes,
                                 Space space,
                                 com.atlassian.user.User user)
Description copied from interface: SpacePermissionManager
Determines if remoteUser has all of the given permissions in space

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.

Specified by:
hasAllPermissions in interface SpacePermissionManager
Parameters:
permissionTypes - A List of permission types (see SpacePermission) to check
space - The space the permissions apply to
Returns:
true if remoteUser has the permission, false otherwise

hasPermissionForSpace

public boolean hasPermissionForSpace(com.atlassian.user.User arg0,
                                     java.util.List arg1,
                                     Space arg2)
Specified by:
hasPermissionForSpace in interface SpacePermissionManager

permissionExists

public boolean permissionExists(SpacePermission arg0)
Description copied from interface: SpacePermissionManager
Check whether the given SpacePermission exists. Checks by attribute equality rather than by id.

Specified by:
permissionExists in interface SpacePermissionManager
Parameters:
arg0 - the permission to look for.
Returns:
true if the permission is recognised by the manager as existing.

getDefaultGlobalPermissions

public java.util.Set<SpacePermission> getDefaultGlobalPermissions()
Description copied from interface: SpacePermissionManager
Returns the default global permissions that are created when Confluence is set up. These will exist in a newly set up system but may be removed afterwards. Note that the returned objects are freshly created and therefore do not have IDs or other persistence data. By default, confluence-administrators group has admin access, the default confluence users group can view the system and anonymous access is disabled.

Specified by:
getDefaultGlobalPermissions in interface SpacePermissionManager
Returns:
a collection of SpacePermissions.

removeAllPermissions

public void removeAllPermissions(Space arg0)
Description copied from interface: SpacePermissionManager
Removes all permissions belonging to space

Specified by:
removeAllPermissions in interface SpacePermissionManager
Parameters:
arg0 - The space to remove the permissions for

removeAllPermissionsForGroup

public void removeAllPermissionsForGroup(java.lang.String arg0)
Specified by:
removeAllPermissionsForGroup in interface SpacePermissionManager

removeAllUserPermissions

public void removeAllUserPermissions(ConfluenceUser user)
Specified by:
removeAllUserPermissions in interface SpacePermissionManager

removeAllUserPermissions

@Deprecated
public void removeAllUserPermissions(java.lang.String arg0)
Deprecated. 

Specified by:
removeAllUserPermissions in interface SpacePermissionManager

removeGlobalPermissionForUser

public void removeGlobalPermissionForUser(ConfluenceUser user,
                                          java.lang.String permissionType)
Description copied from interface: SpacePermissionManager
Removes global permission of specified type that is directly associated with a user

Specified by:
removeGlobalPermissionForUser in interface SpacePermissionManager
Parameters:
user - the user to look up
permissionType - the permission type to remove

removePermission

public void removePermission(SpacePermission arg0)
Specified by:
removePermission in interface SpacePermissionManager

savePermission

public void savePermission(SpacePermission arg0)
Description copied from interface: SpacePermissionSaver
Saves the permission.

Specified by:
savePermission in interface SpacePermissionSaver


Copyright © 2003-2014 Atlassian. All Rights Reserved.