com.atlassian.jira.bc.license
Interface LicenseRoleService

All Known Implementing Classes:
DefaultLicenseRoleService, MockLicenseRoleService

@ExperimentalApi
public interface LicenseRoleService

Provides authorisation-related methods around the provision and consumption of license roles.

Since:
6.3
See Also:
JiraLicenseManager

Field Summary
static String ERROR_GROUPS
          The key for any group related errors reported.
 
Method Summary
 ServiceOutcome<LicenseRole> getRole(LicenseRoleId licenseRoleId)
          Return the LicenseRole identified by the passed LicenseRoleId.
 ServiceOutcome<Set<LicenseRole>> getRoles()
          Return the collection 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.
 boolean userHasRole(ApplicationUser user, LicenseRoleId licenseRoleId)
          Returns true if the given user has the given license role.
 

Field Detail

ERROR_GROUPS

static final String ERROR_GROUPS
The key for any group related errors reported.

See Also:
Constant Field Values
Method Detail

userHasRole

boolean userHasRole(@Nullable
                    ApplicationUser user,
                    @Nonnull
                    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.

getRoles

@Nonnull
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.

getRole

@Nonnull
ServiceOutcome<LicenseRole> getRole(@Nonnull
                                            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.

setGroups

@Nonnull
ServiceOutcome<LicenseRole> setGroups(@Nonnull
                                              LicenseRoleId licenseRoleId,
                                              @Nonnull
                                              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:
the updated LicenseRole or an error.


Copyright © 2002-2014 Atlassian. All Rights Reserved.