|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
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.
| Nested Class Summary | |
|---|---|
static interface |
PermissionManager.Criterion
A criterion for whether an entity should be permitted or not |
| Field Summary | |
|---|---|
static java.lang.Object |
TARGET_APPLICATION
A target that encompasses most administrative functions minus the ones covered by TARGET_SYSTEM. |
static java.lang.Object |
TARGET_SYSTEM
A target that encompasses functions that have system impact and can compromise system security. |
| Method Summary | |
|---|---|
java.util.List |
getPermittedEntities(com.atlassian.user.User user,
Permission permission,
java.util.Iterator objects,
int maxResults)
Filter an iterator based on which entities in the list have a particular permission. |
java.util.List |
getPermittedEntities(com.atlassian.user.User user,
Permission permission,
java.util.Iterator objects,
int maxResults,
java.util.Collection otherCriteria)
Filter an iterator based on which entities in the list have a particular permission. |
java.util.List |
getPermittedEntities(com.atlassian.user.User user,
Permission permission,
java.util.List objects)
Filter a list based on which entities in the list have a particular permission. |
boolean |
hasCreatePermission(com.atlassian.user.User user,
java.lang.Object container,
java.lang.Class typeToCreate)
Determine whether a user has permission to create an entity of a particular type within a given container. |
boolean |
hasPermission(com.atlassian.user.User user,
Permission permission,
java.lang.Object target)
Determine whether a user has a particular permission against a given target. |
boolean |
isConfluenceAdministrator(com.atlassian.user.User user)
Determine if the user is a Confluence administrator. |
boolean |
isGlobalAdministrator(com.atlassian.user.User user)
Deprecated. since 2.7. Please use isConfluenceAdministrator(User). |
| Field Detail |
|---|
static final java.lang.Object TARGET_APPLICATION
static final java.lang.Object TARGET_SYSTEM
| Method Detail |
|---|
boolean hasPermission(com.atlassian.user.User user,
Permission permission,
java.lang.Object target)
user - the user seeking permission, or null if the anonymous user is being checked againstpermission - the permission to checktarget - the object that the permission is being checked against. If this object is null, the method
will return false
java.lang.IllegalStateException - if the permission being checked against does not apply to the target
boolean hasCreatePermission(com.atlassian.user.User user,
java.lang.Object container,
java.lang.Class typeToCreate)
The container is the natural container of the object being created. For example, a comment is contained in a page, which is contained within a space. A space is contained within TARGET_APPLICATION.
user - the user seeking permission, or null if the anonymous user is being checked againstcontainer - the target that the object is being created within. If this object is null, the method
will return falsetypeToCreate - the type of object being created (see above)
java.lang.IllegalStateException - if the permission being checked against does not apply to the targetContentEntityObject.getType()
java.util.List getPermittedEntities(com.atlassian.user.User user,
Permission permission,
java.util.List objects)
user - the user seeking permission, or null if the anonymous user is being checked againstpermission - the permission to check against the objectsobjects - the objects to check
java.util.List getPermittedEntities(com.atlassian.user.User user,
Permission permission,
java.util.Iterator objects,
int maxResults)
user - the user seeking permission, or null if the anonymous user is being checked againstpermission - the permission to check against the objectsobjects - the objects to checkmaxResults - the maximum number of permitted entities to retrieve from the iterator (un-permitted entities are not counted)
java.util.List getPermittedEntities(com.atlassian.user.User user,
Permission permission,
java.util.Iterator objects,
int maxResults,
java.util.Collection otherCriteria)
user - the user seeking permission, or null if the anonymous user is being checked againstpermission - the permission to check against the objectsobjects - the objects to checkmaxResults - the maximum number of permitted entities to retrieve from the iterator (un-permitted entities are not counted)otherCriteria - a collection of PermissionManager.Criterion objects through which the permitted entities must also be filtered
boolean isGlobalAdministrator(com.atlassian.user.User user)
isConfluenceAdministrator(User).
boolean isConfluenceAdministrator(com.atlassian.user.User user)
hasPermission(user, Permission.ADMINISTER, PermissionManager.TARGET_APPLICATION).
user - the user to check permissions against
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||