public class MockLicenseRoleService extends Object implements LicenseRoleService
Modifier and Type | Field and Description |
---|---|
static String |
NOT_FOUND |
ERROR_GROUPS, ERROR_PRIMARY
Constructor and Description |
---|
MockLicenseRoleService() |
Modifier and Type | Method and Description |
---|---|
MockLicenseRole |
addLicenseRole(String id) |
ServiceOutcome<LicenseRole> |
getRole(LicenseRoleId licenseRoleId)
Return the
LicenseRole identified by the passed
LicenseRoleId . |
ServiceOutcome<Set<LicenseRole>> |
getRoles()
Return the
Set of all the roles defined
in the system or an error. |
ServiceOutcome<LicenseRole> |
setGroups(LicenseRoleId licenseRoleId,
Iterable<String> groups)
Set the groups associated with the passed
LicenseRoleId . |
ServiceOutcome<LicenseRole> |
setRole(LicenseRole role)
Save the passed
LicenseRole information to the database. |
boolean |
userHasRole(ApplicationUser user,
LicenseRoleId licenseRoleId)
Returns true if the given user has the given license role regardless of whether a license for that role is
present.
|
public static final String NOT_FOUND
public boolean userHasRole(@Nullable ApplicationUser user, @Nonnull LicenseRoleId licenseRoleId)
LicenseRoleService
userHasRole
in interface LicenseRoleService
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 :)@Nonnull public ServiceOutcome<Set<LicenseRole>> getRoles()
LicenseRoleAdminService
Set
of all the roles defined
in the system or an error.getRoles
in interface LicenseRoleAdminService
@Nonnull public ServiceOutcome<LicenseRole> getRole(@Nonnull LicenseRoleId licenseRoleId)
LicenseRoleAdminService
LicenseRole
identified by the passed
LicenseRoleId
.getRole
in interface LicenseRoleAdminService
licenseRoleId
- the id of the role to find.LicenseRole
with the passed LicenseRoleId
or an error if such a LicenseRole
is not currently installed in JIRA.@Nonnull public ServiceOutcome<LicenseRole> setRole(@Nonnull LicenseRole role)
LicenseRoleAdminService
LicenseRole
information to the database. This method will
only accept the passed role if:
setRole
in interface LicenseRoleAdminService
role
- the role to save.@Nonnull public ServiceOutcome<LicenseRole> setGroups(@Nonnull LicenseRoleId licenseRoleId, @Nonnull Iterable<String> groups)
LicenseRoleAdminService
LicenseRoleId
. The primary group for the role will be unset.setGroups
in interface LicenseRoleAdminService
licenseRoleId
- the id of the license role to update.groups
- the groups to associated with the passed license role.LicenseRole
or an error.public MockLicenseRole addLicenseRole(String id)
Copyright © 2002-2015 Atlassian. All Rights Reserved.