|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.confluence.security.DefaultPermissionManager
public class DefaultPermissionManager
Default implementation of PermissionManager. Delegates all the decision-making to a collection of delegates that handle the per-target-type permission checking.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface com.atlassian.confluence.security.PermissionManager |
---|
PermissionManager.Criterion |
Field Summary |
---|
Fields inherited from interface com.atlassian.confluence.security.PermissionManager |
---|
TARGET_APPLICATION, TARGET_PEOPLE_DIRECTORY, TARGET_SYSTEM |
Constructor Summary | |
---|---|
DefaultPermissionManager()
|
Method Summary | ||
---|---|---|
|
getPermittedEntities(com.atlassian.user.User user,
Permission permission,
Iterator<? extends X> objects,
int maxResults)
Filter an iterator based on which entities in the list have a particular permission. |
|
|
getPermittedEntities(com.atlassian.user.User user,
Permission permission,
Iterator<X> entities,
int maxResults,
Collection<? extends PermissionManager.Criterion> otherCriteria)
Filter an iterator based on which entities in the list have a particular permission. |
|
|
getPermittedEntities(com.atlassian.user.User user,
Permission permission,
List<? extends X> objects)
Filter a list based on which entities in the list have a particular permission. |
|
boolean |
hasCreatePermission(com.atlassian.user.User user,
Object container,
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,
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. |
|
void |
setDeactivatedUserChecker(DeactivatedUserChecker deactivatedUserChecker)
|
|
void |
setDelegates(Map<String,PermissionDelegate> delegates)
|
|
void |
setSpacePermissionManager(SpacePermissionManager spacePermissionManager)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultPermissionManager()
Method Detail |
---|
public boolean hasPermission(com.atlassian.user.User user, Permission permission, Object target)
PermissionManager
hasPermission
in interface PermissionManager
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
public boolean hasCreatePermission(com.atlassian.user.User user, Object container, Class<?> typeToCreate)
PermissionManager
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.
hasCreatePermission
in interface PermissionManager
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)
ContentEntityObject.getType()
public <X> List<X> getPermittedEntities(com.atlassian.user.User user, Permission permission, List<? extends X> objects)
PermissionManager
getPermittedEntities
in interface PermissionManager
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
public <X> List<X> getPermittedEntities(com.atlassian.user.User user, Permission permission, Iterator<? extends X> objects, int maxResults)
PermissionManager
getPermittedEntities
in interface PermissionManager
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)
public <X> List<X> getPermittedEntities(com.atlassian.user.User user, Permission permission, Iterator<X> entities, int maxResults, Collection<? extends PermissionManager.Criterion> otherCriteria)
PermissionManager
getPermittedEntities
in interface PermissionManager
user
- the user seeking permission, or null if the anonymous user is being checked againstpermission
- the permission to check against the objectsentities
- 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
public boolean isConfluenceAdministrator(com.atlassian.user.User user)
PermissionManager
hasPermission(user, Permission.ADMINISTER, PermissionManager.TARGET_APPLICATION)
.
isConfluenceAdministrator
in interface PermissionManager
user
- the user to check permissions against
public void setDelegates(Map<String,PermissionDelegate> delegates)
public void setDeactivatedUserChecker(DeactivatedUserChecker deactivatedUserChecker)
public void setSpacePermissionManager(SpacePermissionManager spacePermissionManager)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |