|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
@PublicApi public interface ManagedConfigurationItemService
This provides an API for plugin developers and for JIRA internally to restrict the administration of certain configuration items. Often, a plugin developer will want to configure JIRA programmatically and rely on that configuration being unchanged. Using this API, the developer can register their desired items as "managed" or "locked" configuration items. This will prevent administrators from changing the configuration and invalidating the plugin's needs.
There are a few different states aManagedConfigurationItem
can be in. These are determined by the properties
ManagedConfigurationItem.isManaged()
and ManagedConfigurationItem.getConfigurationItemAccessLevel()
:
isManaged() == true
- this item is being managed by JIRA or a plugingetConfigurationItemAccessLevel()
- if an item is managed, this property determines who can edit the
item. See ConfigurationItemAccessLevel
for more information.ManagedConfigurationItemType
.
Each configuration item can only have one ManagedConfigurationItem
describing it.
ManagedConfigurationItem
,
ManagedConfigurationItemBuilder
,
ManagedConfigurationItemType
,
ConfigurationItemAccessLevel
Field Summary | |
---|---|
static String |
SOURCE_PREFIX_PLUGIN
Denotes the prefix used in the ManagedConfigurationItem.getSourceId()
field when items are managed by a plugin. |
Method Summary | |
---|---|
boolean |
doesUserHavePermission(com.atlassian.crowd.embedded.api.User user,
ConfigurationItemAccessLevel configurationItemAccessLevel)
Determine if the specified User would have permission to edit an ManagedConfigurationItem with the
specified level. |
boolean |
doesUserHavePermission(com.atlassian.crowd.embedded.api.User user,
ManagedConfigurationItem item)
Determine if the specified User would have permission to edit the ManagedConfigurationItem . |
Collection<ManagedConfigurationItem> |
getManagedConfigurationItems(ManagedConfigurationItemType type)
Retrieves all of the ManagedConfigurationItem s of the specified type which are currently "available"
(meaning their owner is currently available). |
ManagedConfigurationItem |
getManagedCustomField(CustomField customField)
Given the CustomField , attempt to retrieve the ManagedConfigurationItem that describes it. |
ManagedConfigurationItem |
getManagedWorkflow(JiraWorkflow workflow)
Given the JiraWorkflow , attempt to retrieve the ManagedConfigurationItem that describes it. |
ManagedConfigurationItem |
getManagedWorkflowScheme(Long schemeId)
Given the workflow scheme ID, attempt to retrieve the ManagedConfigurationItem that describes it. |
ManagedConfigurationItem |
getManagedWorkflowScheme(WorkflowScheme workflowScheme)
Given the WorkflowScheme , attempt to retrieve the ManagedConfigurationItem that describes it. |
ServiceOutcome<Void> |
removeManagedConfigurationItem(ManagedConfigurationItem item)
Remove the registration of this ManagedConfigurationItem . |
ServiceOutcome<ManagedConfigurationItem> |
updateManagedConfigurationItem(ManagedConfigurationItem item)
Update the registration of this ManagedConfigurationItem . |
Field Detail |
---|
static final String SOURCE_PREFIX_PLUGIN
ManagedConfigurationItem.getSourceId()
field when items are managed by a plugin.
Method Detail |
---|
@Nonnull ManagedConfigurationItem getManagedCustomField(@Nonnull CustomField customField)
CustomField
, attempt to retrieve the ManagedConfigurationItem
that describes it. If it
does not exist, a default implementation will be returned.
If the manager of this item is no longer available (e.g. if a plugin manages a JIRA custom field and the plugin
is disabled) then the item can not be considered managed.
customField
- the custom field
@Nonnull ManagedConfigurationItem getManagedWorkflow(@Nonnull JiraWorkflow workflow)
JiraWorkflow
, attempt to retrieve the ManagedConfigurationItem
that describes it. If it
does not exist, a default implementation will be returned.
If the manager of this item is no longer available (e.g. if a plugin manages a workflow and the plugin
is disabled) then the item can not be considered managed.
workflow
- the workflow
@Nonnull ManagedConfigurationItem getManagedWorkflowScheme(@Nonnull WorkflowScheme workflowScheme)
WorkflowScheme
, attempt to retrieve the ManagedConfigurationItem
that describes it. If it
does not exist, a default implementation will be returned.
If the manager of this item is no longer available (e.g. if a plugin manages a workflow scheme and the plugin
is disabled) then the item can not be considered managed.
workflowScheme
- the workflow scheme
getManagedWorkflowScheme(Long)
@Nonnull ManagedConfigurationItem getManagedWorkflowScheme(@Nonnull Long schemeId)
ManagedConfigurationItem
that describes it. If it
does not exist, a default implementation will be returned.
If the manager of this item is no longer available (e.g. if a plugin manages a workflow scheme and the plugin
is disabled) then the item can not be considered managed.
schemeId
- the workflow scheme ID
getManagedWorkflowScheme(WorkflowScheme)
@Nonnull ServiceOutcome<ManagedConfigurationItem> updateManagedConfigurationItem(@Nonnull ManagedConfigurationItem item)
ManagedConfigurationItem
. If the item was not previously managed, it
will now be managed.
item
- the item to manage
@Nonnull ServiceOutcome<Void> removeManagedConfigurationItem(@Nonnull ManagedConfigurationItem item)
ManagedConfigurationItem
. If the item was not previously managed, an
error will be returned.
item
- the item to stop managing
@Nonnull Collection<ManagedConfigurationItem> getManagedConfigurationItems(@Nonnull ManagedConfigurationItemType type)
ManagedConfigurationItem
s of the specified type which are currently "available"
(meaning their owner is currently available).
type
- the type to retrieve
boolean doesUserHavePermission(com.atlassian.crowd.embedded.api.User user, @Nonnull ManagedConfigurationItem item)
User
would have permission to edit the ManagedConfigurationItem
.
user
- the useritem
- the item
boolean doesUserHavePermission(com.atlassian.crowd.embedded.api.User user, @Nonnull ConfigurationItemAccessLevel configurationItemAccessLevel)
User
would have permission to edit an ManagedConfigurationItem
with the
specified level.
user
- the userconfigurationItemAccessLevel
- the level
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |