@Immutable public interface

ApplicationRole

com.atlassian.jira.application.ApplicationRole
Known Indirect Subclasses

Class Overview

Represents an Application Role in JIRA. An application role defines which users (indirectly through groups) can access an application.

An ApplicationRole is defined by a JIRA plugin through it's module configuration. An ApplicationRole is regarded as licensed when there is a (potentially exceeded) license present in JIRA that provides user seats for the ApplicationRole that is uniquely identified by an ApplicationKey.

Summary

Public Methods
@Nonnull Set<Group> getDefaultGroups()
Return the default groups configured for the role.
@Nonnull Set<Group> getGroups()
Return the set of groups associated with the role including the default ones.
@Nonnull ApplicationKey getKey()
Returns the canonical ApplicationKey that uniquely identifies this ApplicationRole.
@Nonnull String getName()
Return the name of the ApplicationRole.
int getNumberOfSeats()
Returns the total number of seats of this ApplicationRole issued with the licence.
boolean isDefined()
Indicates if the Application/Product is defined.
boolean isPlatform()
Returns whether the role is part of the core platform.
boolean isSelectedByDefault()
Determines whether ApplicationRole should be selected by default on user creation
@Nonnull ApplicationRole withGroups(Iterable<Group> groups, Iterable<Group> defaultGroups)
Return a new ApplicationRole with its groups and default groups set to the passed values.
ApplicationRole withSelectedByDefault(boolean selectedByDefault)
Returns a new ApplicationRole with its selected by default settings set to passed value

Public Methods

@Nonnull public Set<Group> getDefaultGroups ()

Return the default groups configured for the role.

Returns
  • Set with the default groups associated with the role, set will be empty if there are no default groups.

@Nonnull public Set<Group> getGroups ()

Return the set of groups associated with the role including the default ones.

Returns
  • the groups associated with the role.

@Nonnull public ApplicationKey getKey ()

Returns the canonical ApplicationKey that uniquely identifies this ApplicationRole.

Returns
  • the canonical ApplicationKey that uniquely identifies this ApplicationRole.

@Nonnull public String getName ()

Return the name of the ApplicationRole. The name is i18ned for the calling user if possible.

Returns
  • the name of the ApplicationRole role. The name is i18ned for the calling user if possible.

public int getNumberOfSeats ()

Returns the total number of seats of this ApplicationRole issued with the licence.

Returns
  • the total number of seats of this ApplicationRole issued with the licence.

public boolean isDefined ()

Indicates if the Application/Product is defined. This is true when the ApplicationRoleDefinition identified by the ApplicationKey is defined. An ApplicationRole is defined when the JIRA plugin that defines it is installed.

Returns
  • true if the ApplicationRole is defined

public boolean isPlatform ()

Returns whether the role is part of the core platform.

Returns
  • true if the application role is part of the core platform, false if it comes from elsewhere such as a plugin.

public boolean isSelectedByDefault ()

Determines whether ApplicationRole should be selected by default on user creation

Returns
  • true when ApplicationRole should be selected by default on user creation

@Nonnull public ApplicationRole withGroups (Iterable<Group> groups, Iterable<Group> defaultGroups)

Return a new ApplicationRole with its groups and default groups set to the passed values.

Parameters
groups the groups associated with the role.
defaultGroups default groups for the role.
Returns
  • a new ApplicationRole with its groups and default groups set to the passed arguments.
Throws
IllegalArgumentException if groups or defaultGroups contains null or if defaultGroups is not a subset of groups.

public ApplicationRole withSelectedByDefault (boolean selectedByDefault)

Returns a new ApplicationRole with its selected by default settings set to passed value

Parameters
selectedByDefault the new selected by default settings
Returns
  • a new ApplicationRole with its selected by default settings set to passed value