Class UserPermissionsDelegate
- java.lang.Object
-
- com.atlassian.confluence.security.delegate.UserPermissionsDelegate
-
- All Implemented Interfaces:
PermissionDelegate<com.atlassian.user.User>
public class UserPermissionsDelegate extends Object implements PermissionDelegate<com.atlassian.user.User>
Class for checking operations on users.
-
-
Constructor Summary
Constructors Constructor Description UserPermissionsDelegate()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canAdminister(com.atlassian.user.User user, com.atlassian.user.User target)
Unsupported.boolean
canCreate(com.atlassian.user.User user, Object container)
Determines if the specified user has permissions to create usersboolean
canCreateInTarget(com.atlassian.user.User user, Class typeToCreate)
boolean
canEdit(com.atlassian.user.User user, com.atlassian.user.User target)
Determines if the specified user can edit the target user.boolean
canExport(com.atlassian.user.User user, com.atlassian.user.User target)
Unsupported.boolean
canRemove(com.atlassian.user.User user, com.atlassian.user.User target)
Determines if the specified user can remove the target user.boolean
canSetPermissions(com.atlassian.user.User user, com.atlassian.user.User target)
Determines if the specified user can add new permissions or remove existing permissions on the target user.boolean
canView(com.atlassian.user.User user)
boolean
canView(com.atlassian.user.User user, com.atlassian.user.User target)
Determines if the specified user can view the target user.void
setConfluenceAccessManager(ConfluenceAccessManager confluenceAccessManager)
void
setSpacePermissionManager(SpacePermissionManager spacePermissionManager)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.atlassian.confluence.security.PermissionDelegate
canMove, canRemoveHierarchy
-
-
-
-
Method Detail
-
canView
public boolean canView(com.atlassian.user.User user, com.atlassian.user.User target)
Determines if the specified user can view the target user.- Specified by:
canView
in interfacePermissionDelegate<com.atlassian.user.User>
- Returns:
- true if the current user has permission to view user profiles or the user is the same as the target
-
canView
public boolean canView(com.atlassian.user.User user)
- Specified by:
canView
in interfacePermissionDelegate<com.atlassian.user.User>
- Returns:
- true if the user can view all instances of targets handled by this permission delegate
-
canEdit
public boolean canEdit(com.atlassian.user.User user, com.atlassian.user.User target)
Determines if the specified user can edit the target user. A user can always edit themselves. Confluence administrators and System administrators can edit users. The exception to this is that, only system administrators can edit other system administrators.- Specified by:
canEdit
in interfacePermissionDelegate<com.atlassian.user.User>
- Returns:
- true if the specified user can edit the target user. false otherwise.
-
canRemove
public boolean canRemove(com.atlassian.user.User user, com.atlassian.user.User target)
Determines if the specified user can remove the target user. Confluence administrators and System administrators can remove users. The exception to this is that, only system administrators can remove other system administrators.- Specified by:
canRemove
in interfacePermissionDelegate<com.atlassian.user.User>
- Returns:
- true if the specified user can remove the target user. false otherwise.
-
canCreate
public boolean canCreate(com.atlassian.user.User user, Object container)
Determines if the specified user has permissions to create users- Specified by:
canCreate
in interfacePermissionDelegate<com.atlassian.user.User>
- Parameters:
container
- not required. Null can be specified here as it is not used at the moment.- Returns:
- true if the specified user has permissions to create users.
-
canCreateInTarget
public boolean canCreateInTarget(com.atlassian.user.User user, Class typeToCreate)
- Specified by:
canCreateInTarget
in interfacePermissionDelegate<com.atlassian.user.User>
- Parameters:
user
- the user performing the createtypeToCreate
- the class of the entity to create- Returns:
- true if the specified user can create new instances of the specified typeToCreate within instances of target handled by this PermissionDelegate.
-
canExport
public boolean canExport(com.atlassian.user.User user, com.atlassian.user.User target)
Unsupported.- Specified by:
canExport
in interfacePermissionDelegate<com.atlassian.user.User>
-
canSetPermissions
public boolean canSetPermissions(com.atlassian.user.User user, com.atlassian.user.User target)
Determines if the specified user can add new permissions or remove existing permissions on the target user. Confluence administrators and System administrators can set permissions on users. The exception to this is that, only system administrators can set permissions on other system administrators.- Specified by:
canSetPermissions
in interfacePermissionDelegate<com.atlassian.user.User>
- Returns:
- true if the specified user can set permissions on the target user. false otherwise.
-
canAdminister
public boolean canAdminister(com.atlassian.user.User user, com.atlassian.user.User target)
Unsupported.- Specified by:
canAdminister
in interfacePermissionDelegate<com.atlassian.user.User>
-
setSpacePermissionManager
public void setSpacePermissionManager(SpacePermissionManager spacePermissionManager)
-
setConfluenceAccessManager
public void setConfluenceAccessManager(ConfluenceAccessManager confluenceAccessManager)
-
-