com.atlassian.jira.bc.license
Class MockLicenseRoleService
java.lang.Object
com.atlassian.jira.bc.license.MockLicenseRoleService
- All Implemented Interfaces:
- LicenseRoleAdminService, LicenseRoleService
public class MockLicenseRoleService
- extends Object
- implements LicenseRoleService
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NOT_FOUND
public static final String NOT_FOUND
- See Also:
- Constant Field Values
MockLicenseRoleService
public MockLicenseRoleService()
userHasRole
public boolean userHasRole(@Nullable
ApplicationUser user,
@Nonnull
LicenseRoleId licenseRoleId)
- Description copied from interface:
LicenseRoleService
- Returns true if the given user has the given license role regardless of whether a license for that role is
present.
- Specified by:
userHasRole
in interface LicenseRoleService
- Parameters:
user
- the user to check - if this is null, this method returns falselicenseRoleId
- the license role to check - if this is null, you'll get an exception :)
getRoles
@Nonnull
public ServiceOutcome<Set<LicenseRole>> getRoles()
- Description copied from interface:
LicenseRoleAdminService
- Return the collection of all the roles defined in the system or an error.
- Specified by:
getRoles
in interface LicenseRoleAdminService
- Returns:
- the collection of all the roles defined in the system or an error.
getRole
@Nonnull
public ServiceOutcome<LicenseRole> getRole(@Nonnull
LicenseRoleId licenseRoleId)
- Description copied from interface:
LicenseRoleAdminService
- Return the
LicenseRole
identified by the passed
LicenseRoleId
.
- Specified by:
getRole
in interface LicenseRoleAdminService
- Parameters:
licenseRoleId
- the id of the role to find.
- Returns:
- the
LicenseRole
with the passed LicenseRoleId
or an error if such a LicenseRole
is not currently installed in JIRA.
setRole
@Nonnull
public ServiceOutcome<LicenseRole> setRole(@Nonnull
LicenseRole role)
- Description copied from interface:
LicenseRoleAdminService
- Save the passed
LicenseRole
information to the database. This method will
only accept the passed role if:
- The role is authorised.
- The role only contains currently valid groups.
- The primary group is contained within the role.
- Specified by:
setRole
in interface LicenseRoleAdminService
- Parameters:
role
- the role to save.
- Returns:
- the role as persisted to the database or an error.
setGroups
@Nonnull
public ServiceOutcome<LicenseRole> setGroups(@Nonnull
LicenseRoleId licenseRoleId,
@Nonnull
Iterable<String> groups)
- Description copied from interface:
LicenseRoleAdminService
- Set the groups associated with the passed
LicenseRoleId
. The primary group for the role will be unset.
- Specified by:
setGroups
in interface LicenseRoleAdminService
- Parameters:
licenseRoleId
- the id of the license role to update.groups
- the groups to associated with the passed license role.
- Returns:
- the updated
LicenseRole
or an error.
addLicenseRole
public MockLicenseRole addLicenseRole(String id)
Copyright © 2002-2014 Atlassian. All Rights Reserved.