Class GroupAdministrationPermissionServiceImpl
java.lang.Object
com.atlassian.crowd.service.permission.GroupAdministrationPermissionServiceImpl
- All Implemented Interfaces:
GroupAdministrationPermissionService
@Transactional
public class GroupAdministrationPermissionServiceImpl
extends Object
implements GroupAdministrationPermissionService
-
Constructor Summary
ConstructorDescriptionGroupAdministrationPermissionServiceImpl
(ApplicationDAO applicationDAO, UserAdministrationGrantGroupDao userGrantDao, GroupAdministrationGrantGroupDao groupGrantDao, InternalGroupDao internalGroupDao, InternalUserDao internalUserDao, DirectoryManager directoryManager, AuthenticatedUserProvider authenticatedUserProvider, DcLicenseChecker dcLicenseChecker) -
Method Summary
Modifier and TypeMethodDescriptiongetAdministeredGroups
(User user, AdministeredGroupsQuery query) Looks for groups a user administersLooks for groups that currently logged in user administersgetDirectGroupLevelAdminGroups
(boolean considerOnlyTargetGroupsWithApplications) getDirectGroupLevelAdminUsers
(boolean considerOnlyTargetGroupsWithApplications) boolean
isCurrentUserAdminOfGroup
(Group group) Check if a current logged in user is an administrator of a groupboolean
isUserAdminOfGroup
(User user, Group group) Check if a user is an administrator of a groupboolean
isUserGroupLevelAdmin
(User user) void
setUserPermissionService
(UserPermissionService userPermissionService)
-
Constructor Details
-
GroupAdministrationPermissionServiceImpl
public GroupAdministrationPermissionServiceImpl(ApplicationDAO applicationDAO, UserAdministrationGrantGroupDao userGrantDao, GroupAdministrationGrantGroupDao groupGrantDao, InternalGroupDao internalGroupDao, InternalUserDao internalUserDao, DirectoryManager directoryManager, AuthenticatedUserProvider authenticatedUserProvider, DcLicenseChecker dcLicenseChecker)
-
-
Method Details
-
getAdministeredGroupsForCurrentUser
public List<UserGroupAdministrationMapping> getAdministeredGroupsForCurrentUser(@Nonnull AdministeredGroupsQuery query) throws OperationFailedException, FeatureInaccessibleException Description copied from interface:GroupAdministrationPermissionService
Looks for groups that currently logged in user administers- Specified by:
getAdministeredGroupsForCurrentUser
in interfaceGroupAdministrationPermissionService
- 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:
OperationFailedException
FeatureInaccessibleException
-
getAdministeredGroups
public List<UserGroupAdministrationMapping> getAdministeredGroups(User user, @Nonnull AdministeredGroupsQuery query) throws OperationFailedException, FeatureInaccessibleException Description copied from interface:GroupAdministrationPermissionService
Looks for groups a user administers- Specified by:
getAdministeredGroups
in interfaceGroupAdministrationPermissionService
- 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:
OperationFailedException
FeatureInaccessibleException
-
isUserGroupLevelAdmin
- Specified by:
isUserGroupLevelAdmin
in interfaceGroupAdministrationPermissionService
- 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:
OperationFailedException
-
isCurrentUserAdminOfGroup
public boolean isCurrentUserAdminOfGroup(Group group) throws GroupNotFoundException, DirectoryNotFoundException, OperationFailedException, FeatureInaccessibleException Description copied from interface:GroupAdministrationPermissionService
Check if a current logged in user is an administrator of a group- Specified by:
isCurrentUserAdminOfGroup
in interfaceGroupAdministrationPermissionService
- Parameters:
group
- the group- Returns:
true
if the user is an administrator of the group,false
otherwise- Throws:
GroupNotFoundException
DirectoryNotFoundException
OperationFailedException
FeatureInaccessibleException
-
isUserAdminOfGroup
public boolean isUserAdminOfGroup(User user, Group group) throws GroupNotFoundException, DirectoryNotFoundException, OperationFailedException, FeatureInaccessibleException Description copied from interface:GroupAdministrationPermissionService
Check if a user is an administrator of a group- Specified by:
isUserAdminOfGroup
in interfaceGroupAdministrationPermissionService
- Parameters:
user
- the usergroup
- the group- Returns:
true
if the user is an administrator of the group,false
otherwise- Throws:
GroupNotFoundException
DirectoryNotFoundException
OperationFailedException
FeatureInaccessibleException
-
setUserPermissionService
-
getDirectGroupLevelAdminUsers
- Specified by:
getDirectGroupLevelAdminUsers
in interfaceGroupAdministrationPermissionService
- 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
- Specified by:
getDirectGroupLevelAdminGroups
in interfaceGroupAdministrationPermissionService
- Parameters:
considerOnlyTargetGroupsWithApplications
- whether only groups with mapped application should be taken into account- Returns:
- set of groups with direct grants to manage any group
-