Interface GroupAdministrationPermissionService
@ExperimentalApi
public interface GroupAdministrationPermissionService
Allows clients to check group permissions of users
- Since:
- 3.3.0
-
Method Summary
Modifier and TypeMethodDescriptiongetAdministeredGroups(com.atlassian.crowd.model.user.User user, AdministeredGroupsQuery query) Looks for groups a user administersLooks for groups that currently logged in user administersSet<com.atlassian.crowd.model.group.Group> getDirectGroupLevelAdminGroups(boolean considerOnlyTargetGroupsWithApplications) Set<com.atlassian.crowd.model.user.User> getDirectGroupLevelAdminUsers(boolean considerOnlyTargetGroupsWithApplications) booleanisCurrentUserAdminOfGroup(com.atlassian.crowd.model.group.Group group) Check if a current logged in user is an administrator of a groupbooleanisUserAdminOfGroup(com.atlassian.crowd.model.user.User user, com.atlassian.crowd.model.group.Group group) Check if a user is an administrator of a groupbooleanisUserGroupLevelAdmin(com.atlassian.crowd.model.user.User user)
-
Method Details
-
getAdministeredGroupsForCurrentUser
List<UserGroupAdministrationMapping> getAdministeredGroupsForCurrentUser(@Nonnull AdministeredGroupsQuery query) throws com.atlassian.crowd.exception.OperationFailedException, com.atlassian.crowd.exception.FeatureInaccessibleException Looks for groups that currently logged in user administers- Parameters:
query- the criteria that the returned groups must meet or null for all groups- Returns:
- a set of mappings containing all groups currently logged in user administers
- Throws:
IllegalStateException- if user associated with the current session, no more exists in the directorycom.atlassian.crowd.exception.OperationFailedExceptioncom.atlassian.crowd.exception.FeatureInaccessibleException
-
getAdministeredGroups
List<UserGroupAdministrationMapping> getAdministeredGroups(com.atlassian.crowd.model.user.User user, @Nonnull AdministeredGroupsQuery query) throws com.atlassian.crowd.exception.OperationFailedException, com.atlassian.crowd.exception.FeatureInaccessibleException Looks for groups a user administers- Parameters:
user- the userquery- the criteria that the returned groups must meet or null for all groups- Returns:
- a set of mappings containing all groups user can administer
- Throws:
IllegalStateException- if the supplied user doesn't existscom.atlassian.crowd.exception.OperationFailedExceptioncom.atlassian.crowd.exception.FeatureInaccessibleException
-
isUserGroupLevelAdmin
boolean isUserGroupLevelAdmin(com.atlassian.crowd.model.user.User user) throws com.atlassian.crowd.exception.OperationFailedException - Parameters:
user- the user- Returns:
- true if the specified user administers at least one group, either through a directly assigned grant or through memberships
- Throws:
com.atlassian.crowd.exception.OperationFailedException
-
isCurrentUserAdminOfGroup
boolean isCurrentUserAdminOfGroup(com.atlassian.crowd.model.group.Group group) throws com.atlassian.crowd.exception.GroupNotFoundException, com.atlassian.crowd.exception.UserNotFoundException, com.atlassian.crowd.exception.DirectoryNotFoundException, com.atlassian.crowd.exception.OperationFailedException, com.atlassian.crowd.exception.FeatureInaccessibleException Check if a current logged in user is an administrator of a group- Parameters:
group- the group- Returns:
trueif the user is an administrator of the group,falseotherwise- Throws:
com.atlassian.crowd.exception.GroupNotFoundExceptioncom.atlassian.crowd.exception.UserNotFoundExceptioncom.atlassian.crowd.exception.DirectoryNotFoundExceptioncom.atlassian.crowd.exception.OperationFailedExceptioncom.atlassian.crowd.exception.FeatureInaccessibleException
-
isUserAdminOfGroup
boolean isUserAdminOfGroup(com.atlassian.crowd.model.user.User user, com.atlassian.crowd.model.group.Group group) throws com.atlassian.crowd.exception.GroupNotFoundException, com.atlassian.crowd.exception.UserNotFoundException, com.atlassian.crowd.exception.DirectoryNotFoundException, com.atlassian.crowd.exception.OperationFailedException, com.atlassian.crowd.exception.FeatureInaccessibleException Check if a user is an administrator of a group- Parameters:
user- the usergroup- the group- Returns:
trueif the user is an administrator of the group,falseotherwise- Throws:
com.atlassian.crowd.exception.GroupNotFoundExceptioncom.atlassian.crowd.exception.UserNotFoundExceptioncom.atlassian.crowd.exception.DirectoryNotFoundExceptioncom.atlassian.crowd.exception.OperationFailedExceptioncom.atlassian.crowd.exception.FeatureInaccessibleException
-
getDirectGroupLevelAdminUsers
Set<com.atlassian.crowd.model.user.User> getDirectGroupLevelAdminUsers(boolean considerOnlyTargetGroupsWithApplications) - Parameters:
considerOnlyTargetGroupsWithApplications- whether only groups with mapped application should be taken into account- Returns:
- set of users with direct grants to manage any group
-
getDirectGroupLevelAdminGroups
Set<com.atlassian.crowd.model.group.Group> getDirectGroupLevelAdminGroups(boolean considerOnlyTargetGroupsWithApplications) - Parameters:
considerOnlyTargetGroupsWithApplications- whether only groups with mapped application should be taken into account- Returns:
- set of groups with direct grants to manage any group
-