com.atlassian.bamboo.security
Interface PermissionManager

All Known Implementing Classes:
DefaultPermissionManager

public interface PermissionManager

Generalised interface for checking whether a particular action in Confluence is allowed, without any knowledge of the specific implementation of permissions as they relate to spaces, pages and so on.


Field Summary
static Object GLOBAL_PERMISSION
          A target to represent the Confluence application as a whole, for global tests
 
Method Summary
 List filterPermittedEntities(User user, Permission permission, Iterator objects, int maxResults)
          Filter an iterator based on which entities in the list have a particular permission.
 List filterPermittedEntities(User user, Permission permission, List objects)
          Filter a list based on which entities in the list have a particular permission.
 boolean hasPermission(User user, Permission permission, Object target)
          Determine whether a user has a particular permission against a given target.
 

Field Detail

GLOBAL_PERMISSION

static final Object GLOBAL_PERMISSION
A target to represent the Confluence application as a whole, for global tests

Method Detail

hasPermission

boolean hasPermission(User user,
                      Permission permission,
                      Object target)
Determine whether a user has a particular permission against a given target.

Parameters:
user - the user seeking permission, or null if the anonymous user is being checked against
permission - the permission to check
target - the object that the permission is being checked against. If this object is null, the method will return false
Returns:
true if the user has this permission, false otherwise
Throws:
IllegalStateException - if the permission being checked against does not apply to the target

filterPermittedEntities

List filterPermittedEntities(User user,
                             Permission permission,
                             List objects)
Filter a list based on which entities in the list have a particular permission.

Parameters:
user - the user seeking permission, or null if the anonymous user is being checked against
permission - the permission to check against the objects
objects - the objects to check
Returns:
a new list of those members of the objects list that satisfy the given permission for the user

filterPermittedEntities

List filterPermittedEntities(User user,
                             Permission permission,
                             Iterator objects,
                             int maxResults)
Filter an iterator based on which entities in the list have a particular permission.

Parameters:
user - the user seeking permission, or null if the anonymous user is being checked against
permission - the permission to check against the objects
objects - the objects to check
maxResults - the maximum number of permitted entities to retrieve from the iterator (un-permitted entities are not counted)
Returns:
a new list of those members of the objects list that satisfy the given permission for the user


Copyright © 2006 Atlassian Software Systems. All Rights Reserved.