Package com.atlassian.jira.application
Interface ApplicationRole
- All Known Implementing Classes:
MockApplicationRole
@Immutable
public interface ApplicationRole
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.
- Since:
- v7.0
-
Method Summary
Modifier and TypeMethodDescriptionSet<com.atlassian.crowd.embedded.api.Group> Return the default groups configured for the role.Set<com.atlassian.crowd.embedded.api.Group> Return the set of groups associated with the role including the default ones.com.atlassian.application.api.ApplicationKeygetKey()Returns the canonicalApplicationKeythat uniquely identifies thisApplicationRole.getName()Return the name of theApplicationRole.intReturns the total number of seats of thisApplicationRoleissued with the licence.booleanIndicates if the Application/Product is defined.booleanReturns whether the role is part of the core platform.booleanDetermines whetherApplicationRoleshould be selected by default on user creationwithGroups(Iterable<com.atlassian.crowd.embedded.api.Group> groups, Iterable<com.atlassian.crowd.embedded.api.Group> defaultGroups) Return a newApplicationRolewith its groups and default groups set to the passed values.withSelectedByDefault(boolean selectedByDefault) Returns a newApplicationRolewith its selected by default settings set to passed value
-
Method Details
-
getKey
@Nonnull com.atlassian.application.api.ApplicationKey getKey()Returns the canonicalApplicationKeythat uniquely identifies thisApplicationRole.- Returns:
- the canonical
ApplicationKeythat uniquely identifies thisApplicationRole.
-
getName
Return the name of theApplicationRole. The name is i18ned for the calling user if possible.- Returns:
- the name of the
ApplicationRolerole. The name is i18ned for the calling user if possible.
-
getGroups
Return the set of groups associated with the role including the default ones.- Returns:
- the groups associated with the role.
-
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.
-
withGroups
@Nonnull ApplicationRole withGroups(@Nonnull Iterable<com.atlassian.crowd.embedded.api.Group> groups, @Nonnull Iterable<com.atlassian.crowd.embedded.api.Group> defaultGroups) Return a newApplicationRolewith 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
ApplicationRolewith 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.
-
getNumberOfSeats
int getNumberOfSeats()Returns the total number of seats of thisApplicationRoleissued with the licence.- Returns:
- the total number of seats of this
ApplicationRoleissued with the licence.
-
isSelectedByDefault
boolean isSelectedByDefault()Determines whetherApplicationRoleshould be selected by default on user creation- Returns:
truewhenApplicationRoleshould be selected by default on user creation
-
withSelectedByDefault
Returns a newApplicationRolewith its selected by default settings set to passed value- Parameters:
selectedByDefault- the new selected by default settings- Returns:
- a new
ApplicationRolewith its selected by default settings set to passed value
-
isDefined
boolean isDefined()Indicates if the Application/Product is defined. This is true when theApplicationRoleDefinitionidentified by theApplicationKeyis defined. AnApplicationRoleis defined when the JIRA plugin that defines it is installed.- Returns:
trueif theApplicationRoleis defined
-
isPlatform
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.
-