com.atlassian.jira.bc.license
Class MockLicenseRoleService

java.lang.Object
  extended by com.atlassian.jira.bc.license.MockLicenseRoleService
All Implemented Interfaces:
LicenseRoleService

public class MockLicenseRoleService
extends Object
implements LicenseRoleService


Field Summary
static String NOT_FOUND
           
 
Fields inherited from interface com.atlassian.jira.bc.license.LicenseRoleService
ERROR_GROUPS
 
Constructor Summary
MockLicenseRoleService()
           
 
Method Summary
 MockLicenseRole addLicenseRole(String id)
           
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NOT_FOUND

public static final String NOT_FOUND
See Also:
Constant Field Values
Constructor Detail

MockLicenseRoleService

public MockLicenseRoleService()
Method Detail

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.

Specified by:
userHasRole in interface LicenseRoleService
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
public ServiceOutcome<Set<LicenseRole>> getRoles()
Description copied from interface: LicenseRoleService
Return the collection of all the roles defined in the system or an error.

Specified by:
getRoles in interface LicenseRoleService
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: LicenseRoleService
Return the LicenseRole identified by the passed LicenseRoleId.

Specified by:
getRole in interface LicenseRoleService
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
public ServiceOutcome<LicenseRole> setGroups(@Nonnull
                                                     LicenseRoleId licenseRoleId,
                                                     @Nonnull
                                                     Iterable<String> groups)
Description copied from interface: LicenseRoleService
Set the groups associated with the passed LicenseRoleId.

Specified by:
setGroups in interface LicenseRoleService
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.