public class UserPermissionServiceImpl extends Object implements UserPermissionService
Constructor and Description |
---|
UserPermissionServiceImpl(InternalUserPermissionDAO userPermissionDAO,
DirectoryManager directoryManager,
AuthenticatedUserProvider userProvider,
ApplicationService applicationService,
CrowdApplicationFactory crowdApplicationFactory,
GroupAdministrationPermissionService groupAdministrationPermissionService) |
Modifier and Type | Method and Description |
---|---|
boolean |
currentUserHasPermission(UserPermission permission)
Does the current user have the provided permission.
|
Set<User> |
getGroupLevelAdmins(boolean considerOnlyTargetGroupsWithApplications) |
Set<User> |
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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getSysAdmins
public UserPermissionServiceImpl(InternalUserPermissionDAO userPermissionDAO, DirectoryManager directoryManager, AuthenticatedUserProvider userProvider, ApplicationService applicationService, CrowdApplicationFactory crowdApplicationFactory, GroupAdministrationPermissionService groupAdministrationPermissionService)
public boolean currentUserHasPermission(UserPermission permission)
UserPermissionService
currentUserHasPermission
in interface UserPermissionService
permission
- permission requiredpublic boolean hasPermission(@Nullable String username, UserPermission permission)
UserPermissionService
hasPermission
in interface UserPermissionService
username
- user to check, null for the anonymous userpermission
- permission requiredpublic boolean hasPermissionOutsideOfGroups(@Nullable String username, UserPermission permission, Collection<DirectoryGroup> excludedGroups)
UserPermissionService
This method is intended to be used to determine if a group is exclusively providing a given permission.
hasPermissionOutsideOfGroups
in interface UserPermissionService
username
- user to check, null for the anonymous userpermission
- permission requiredexcludedGroups
- groups to exclude in permission check, or an empty list otherwisepublic boolean isGroupLevelAdmin(@Nullable String username)
UserPermissionService
isGroupLevelAdmin
in interface UserPermissionService
username
- user to check, null for anonymous userpublic Set<User> getUsersWithPermission(Application application, UserPermission permission, boolean includeLocallyCachedOnly) throws DirectoryNotFoundException, OperationFailedException
getUsersWithPermission
in interface UserPermissionService
application
- application the permission applies topermission
- permission to checkincludeLocallyCachedOnly
- if set to true will limit search to users stored locallyDirectoryNotFoundException
OperationFailedException
public Set<User> getGroupLevelAdmins(boolean considerOnlyTargetGroupsWithApplications) throws DirectoryNotFoundException, OperationFailedException
getGroupLevelAdmins
in interface UserPermissionService
considerOnlyTargetGroupsWithApplications
- whether groups without any active application should be taken into accountDirectoryNotFoundException
OperationFailedException
Copyright © 2020 Atlassian. All rights reserved.