Class UserPermissionServiceImpl
java.lang.Object
com.atlassian.crowd.manager.permission.UserPermissionServiceImpl
- All Implemented Interfaces:
UserPermissionService
- Direct Known Subclasses:
RecoveryModeAwareUserPermissionService
-
Constructor Summary
ConstructorDescriptionUserPermissionServiceImpl
(InternalUserPermissionDAO userPermissionDAO, DirectoryManager directoryManager, AuthenticatedUserProvider userProvider, ApplicationService applicationService, CrowdApplicationFactory crowdApplicationFactory, GroupAdministrationPermissionService groupAdministrationPermissionService) -
Method Summary
Modifier and TypeMethodDescriptionboolean
currentUserHasPermission
(UserPermission permission) Does the current user have the provided permission.getGroupLevelAdmins
(boolean considerOnlyTargetGroupsWithApplications) getUsersWithPermission
(Application application, UserPermission permission, boolean includeLocallyCachedOnly) boolean
hasPermission
(String username, UserPermission permission) Does the provided user have the provided permission.boolean
hasPermissionOutsideOfGroups
(String username, UserPermission permission, Collection<DirectoryGroup> excludedGroups) Does the provided user have the provided permission when not considering the provided groups.boolean
isGroupLevelAdmin
(String username) Does the provided user have Group Level Admin permissions.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.atlassian.crowd.manager.permission.UserPermissionService
getSysAdmins
-
Constructor Details
-
UserPermissionServiceImpl
public UserPermissionServiceImpl(InternalUserPermissionDAO userPermissionDAO, DirectoryManager directoryManager, AuthenticatedUserProvider userProvider, ApplicationService applicationService, CrowdApplicationFactory crowdApplicationFactory, GroupAdministrationPermissionService groupAdministrationPermissionService)
-
-
Method Details
-
currentUserHasPermission
Description copied from interface:UserPermissionService
Does the current user have the provided permission.- Specified by:
currentUserHasPermission
in interfaceUserPermissionService
- Parameters:
permission
- permission required- Returns:
- true if the user has permission
-
hasPermission
Description copied from interface:UserPermissionService
Does the provided user have the provided permission.- Specified by:
hasPermission
in interfaceUserPermissionService
- Parameters:
username
- user to check, null for the anonymous userpermission
- permission required- Returns:
- true if the user has permission
-
hasPermissionOutsideOfGroups
public boolean hasPermissionOutsideOfGroups(@Nullable String username, UserPermission permission, Collection<DirectoryGroup> excludedGroups) Description copied from interface:UserPermissionService
Does the provided user have the provided permission when not considering the provided groups.This method is intended to be used to determine if a group is exclusively providing a given permission.
- Specified by:
hasPermissionOutsideOfGroups
in interfaceUserPermissionService
- Parameters:
username
- user to check, null for the anonymous userpermission
- permission requiredexcludedGroups
- groups to exclude in permission check, or an empty list otherwise- Returns:
- true if the user has permission outside of the provided groups
-
isGroupLevelAdmin
Description copied from interface:UserPermissionService
Does the provided user have Group Level Admin permissions.- Specified by:
isGroupLevelAdmin
in interfaceUserPermissionService
- Parameters:
username
- user to check, null for anonymous user- Returns:
- true if the user has Group Level Admin permissions
-
getUsersWithPermission
public Set<User> getUsersWithPermission(Application application, UserPermission permission, boolean includeLocallyCachedOnly) throws DirectoryNotFoundException, OperationFailedException - Specified by:
getUsersWithPermission
in interfaceUserPermissionService
- Parameters:
application
- application the permission applies topermission
- permission to checkincludeLocallyCachedOnly
- if set to true will limit search to users stored locally- Returns:
- users with the given permission
- Throws:
DirectoryNotFoundException
OperationFailedException
-
getGroupLevelAdmins
public Set<User> getGroupLevelAdmins(boolean considerOnlyTargetGroupsWithApplications) throws DirectoryNotFoundException, OperationFailedException - Specified by:
getGroupLevelAdmins
in interfaceUserPermissionService
- Parameters:
considerOnlyTargetGroupsWithApplications
- whether groups without any active application should be taken into account- Returns:
- users with group level admin permission.
- Throws:
DirectoryNotFoundException
OperationFailedException
-