public class

MockLicenseRoleService

extends Object
implements LicenseRoleService
java.lang.Object
   ↳ com.atlassian.jira.bc.license.MockLicenseRoleService

Summary

Constants
String NOT_FOUND
[Expand]
Inherited Constants
From interface com.atlassian.jira.bc.license.LicenseRoleService
Public Constructors
MockLicenseRoleService()
Public Methods
MockLicenseRole addLicenseRole(String id)
@Nonnull ServiceOutcome<LicenseRole> getRole(LicenseRoleId licenseRoleId)
Return the LicenseRole identified by the passed LicenseRoleId.
@Nonnull ServiceOutcome<Set<LicenseRole>> getRoles()
Return the collection of all the roles defined in the system or an error.
@Nonnull ServiceOutcome<LicenseRole> setGroups(LicenseRoleId licenseRoleId, Iterable<String> groups)
Set the groups associated with the passed LicenseRoleId.
boolean userHasRole(ApplicationUser user, LicenseRoleId licenseRoleId)
Returns true if the given user has the given license role.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.jira.bc.license.LicenseRoleService

Constants

public static final String NOT_FOUND

Constant Value: "Not Found"

Public Constructors

public MockLicenseRoleService ()

Public Methods

public MockLicenseRole addLicenseRole (String id)

@Nonnull public ServiceOutcome<LicenseRole> getRole (LicenseRoleId licenseRoleId)

Return the LicenseRole identified by the passed LicenseRoleId.

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.

@Nonnull public ServiceOutcome<Set<LicenseRole>> getRoles ()

Return the collection of all the roles defined in the system or an error.

Returns
  • the collection of all the roles defined in the system or an error.

@Nonnull public ServiceOutcome<LicenseRole> setGroups (LicenseRoleId licenseRoleId, Iterable<String> groups)

Set the groups associated with the passed LicenseRoleId.

Parameters
licenseRoleId the id of the license role to update.
groups the groups to associated with the passed license role.
Returns

public boolean userHasRole (ApplicationUser user, LicenseRoleId licenseRoleId)

Returns true if the given user has the given license role.

Parameters
user the user to check
licenseRoleId the license role to check
Returns
  • true if the given user has the given license role.