public interface UserPermissionService
| Modifier and Type | Method and Description |
|---|---|
boolean |
currentUserHasPermission(UserPermission permission)
Does the current user have the provided permission.
|
Set<User> |
getGroupLevelAdmins(boolean considerOnlyTargetGroupsWithApplications) |
default Set<User> |
getSysAdmins(Application application,
boolean includeLocallyCachedOnly) |
Set<User> |
getUsersWithPermission(Application application,
UserPermission userPermission,
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.
|
boolean currentUserHasPermission(UserPermission permission)
permission - permission requiredboolean hasPermission(@Nullable String username, UserPermission permission)
username - user to check, null for the anonymous userpermission - permission requiredboolean hasPermissionOutsideOfGroups(@Nullable String username, UserPermission permission, Collection<DirectoryGroup> excludedGroups)
This method is intended to be used to determine if a group is exclusively providing a given permission.
username - user to check, null for the anonymous userpermission - permission requiredexcludedGroups - groups to exclude in permission check, or an empty list otherwiseboolean isGroupLevelAdmin(@Nullable String username)
username - user to check, null for anonymous user@ExperimentalApi default Set<User> getSysAdmins(Application application, boolean includeLocallyCachedOnly) throws com.atlassian.crowd.exception.DirectoryNotFoundException, com.atlassian.crowd.exception.OperationFailedException
application - application the permission applies toincludeLocallyCachedOnly - if set to true will limit search to users stored locallycom.atlassian.crowd.exception.DirectoryNotFoundExceptioncom.atlassian.crowd.exception.OperationFailedException@ExperimentalApi Set<User> getUsersWithPermission(Application application, UserPermission userPermission, boolean includeLocallyCachedOnly) throws com.atlassian.crowd.exception.DirectoryNotFoundException, com.atlassian.crowd.exception.OperationFailedException
application - application the permission applies touserPermission - permission to checkincludeLocallyCachedOnly - if set to true will limit search to users stored locallycom.atlassian.crowd.exception.DirectoryNotFoundExceptioncom.atlassian.crowd.exception.OperationFailedException@ExperimentalApi Set<User> getGroupLevelAdmins(boolean considerOnlyTargetGroupsWithApplications) throws com.atlassian.crowd.exception.DirectoryNotFoundException, com.atlassian.crowd.exception.OperationFailedException
considerOnlyTargetGroupsWithApplications - whether groups without any active application should be taken into accountcom.atlassian.crowd.exception.DirectoryNotFoundExceptioncom.atlassian.crowd.exception.OperationFailedExceptionCopyright © 2023 Atlassian. All rights reserved.