com.atlassian.jira.permission
Class WorkflowBasedPermissionSchemeManager

java.lang.Object
  extended by com.atlassian.jira.scheme.AbstractSchemeManager
      extended by com.atlassian.jira.permission.DefaultPermissionSchemeManager
          extended by com.atlassian.jira.permission.WorkflowBasedPermissionSchemeManager
All Implemented Interfaces:
Startable, PermissionSchemeManager, SchemeManager

public class WorkflowBasedPermissionSchemeManager
extends DefaultPermissionSchemeManager
implements Startable

Custom permission scheme manager that allows the list of assignable users to be restricted by workflow state. In jira-workflow.xml, every step can have a meta attribute stating which groups are assignable:

<step id="23" name="Pending Biz User Approval"> .... <meta name="jira.permission.assignable.group">${pkey}-bizusers</meta>

When getUsers(Long, PermissionContext) is called to discover assignable users, this permission scheme manager first does the regular "Assignable" check, and then filters returned users for membership of the 'jira.permission.assignable.group' (in this example). If jira.permission.assignable.* isn't specified for a step, all permission-derived users are returned.

See Also:
WorkflowBasedPermissionManager

Field Summary
 
Fields inherited from class com.atlassian.jira.scheme.AbstractSchemeManager
groupManager, projectManager, schemeFactory, securityTypeManager
 
Fields inherited from interface com.atlassian.jira.scheme.SchemeManager
PROJECT_ASSOCIATION
 
Constructor Summary
WorkflowBasedPermissionSchemeManager(ProjectManager projectManager, PermissionTypeManager permissionTypeManager, WorkflowPermissionFactory workflowPermissionFactory, PermissionContextFactory permissionContextFactory, OfBizDelegator ofBizDelegator, SchemeFactory schemeFactory, com.atlassian.event.api.EventPublisher eventPublisher, NodeAssociationStore nodeAssociationStore, GroupManager groupManager, com.atlassian.cache.CacheManager cacheManager)
           
 
Method Summary
 Collection<com.atlassian.crowd.embedded.api.User> getUsers(Long permissionId, PermissionContext ctx)
           
 Collection<com.atlassian.crowd.embedded.api.User> getUsers(ProjectPermissionKey permissionKey, PermissionContext ctx)
           
 void onClearCache(ClearCacheEvent event)
           
 void start()
          Registers this CachingFieldConfigContextPersister's cache in the JIRA instrumentation.
 
Methods inherited from class com.atlassian.jira.permission.DefaultPermissionSchemeManager
createSchemeAddedToProjectEvent, createSchemeCopiedEvent, createSchemeCreatedEvent, createSchemeEntity, createSchemeEntityDeletedEvent, createSchemeEntityNoEvent, createSchemeRemovedFromProjectEvent, createSchemeUpdatedEvent, deleteEntity, deleteScheme, flushSchemeEntities, getDefaultDescriptionKey, getDefaultNameKey, getEntities, getEntities, getEntities, getEntities, getEntities, getEntities, getEntities, getEntities, getEntities, getEntitiesByType, getEntityName, getGroups, getGroups, getGroups, getSchemeDesc, getSchemeEntityName, getSchemesContainingEntity, hasSchemeAuthority, hasSchemeAuthority, hasSchemeAuthority, hasSchemeAuthority, makeSchemeEntity, removeEntities, removeEntities
 
Methods inherited from class com.atlassian.jira.scheme.AbstractSchemeManager
addDefaultSchemeToProject, addDefaultSchemeToProject, addSchemeToProject, addSchemeToProject, copyScheme, copyScheme, createDefaultScheme, createScheme, createSchemeAndEntities, createSchemeGenericValue, createSchemeNoEvent, createSchemeObject, flushProjectSchemes, getApplicationI18n, getAssociatedSchemes, getAssociationType, getDefaultScheme, getDefaultSchemeObject, getEntities, getEntity, getNameForCopy, getProjects, getProjects, getScheme, getScheme, getSchemeFor, getSchemeObject, getSchemeObject, getSchemeObjects, getSchemes, getSchemes, getUnassociatedSchemes, getUsers, getUsers, getUsers, removeSchemesFromProject, removeSchemesFromProject, schemeExists, updateScheme, updateScheme
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.atlassian.jira.permission.PermissionSchemeManager
getAssociationType
 
Methods inherited from interface com.atlassian.jira.scheme.SchemeManager
addDefaultSchemeToProject, addDefaultSchemeToProject, addSchemeToProject, addSchemeToProject, copyScheme, copyScheme, createDefaultScheme, createScheme, createSchemeAndEntities, createSchemeObject, getAssociatedSchemes, getDefaultScheme, getDefaultSchemeObject, getEntities, getEntity, getProjects, getProjects, getScheme, getScheme, getSchemeFor, getSchemeObject, getSchemeObject, getSchemeObjects, getSchemes, getSchemes, getUnassociatedSchemes, getUsers, getUsers, getUsers, removeSchemesFromProject, removeSchemesFromProject, schemeExists, updateScheme, updateScheme
 

Constructor Detail

WorkflowBasedPermissionSchemeManager

public WorkflowBasedPermissionSchemeManager(ProjectManager projectManager,
                                            PermissionTypeManager permissionTypeManager,
                                            WorkflowPermissionFactory workflowPermissionFactory,
                                            PermissionContextFactory permissionContextFactory,
                                            OfBizDelegator ofBizDelegator,
                                            SchemeFactory schemeFactory,
                                            com.atlassian.event.api.EventPublisher eventPublisher,
                                            NodeAssociationStore nodeAssociationStore,
                                            GroupManager groupManager,
                                            com.atlassian.cache.CacheManager cacheManager)
Method Detail

start

public void start()
           throws Exception
Description copied from class: DefaultPermissionSchemeManager
Registers this CachingFieldConfigContextPersister's cache in the JIRA instrumentation.

Specified by:
start in interface Startable
Overrides:
start in class DefaultPermissionSchemeManager
Throws:
Exception - Allows implementations to throw an Exception.

onClearCache

@EventListener
public void onClearCache(ClearCacheEvent event)
Overrides:
onClearCache in class DefaultPermissionSchemeManager

getUsers

public Collection<com.atlassian.crowd.embedded.api.User> getUsers(Long permissionId,
                                                                  PermissionContext ctx)
Specified by:
getUsers in interface PermissionSchemeManager
Specified by:
getUsers in interface SchemeManager
Overrides:
getUsers in class AbstractSchemeManager

getUsers

public Collection<com.atlassian.crowd.embedded.api.User> getUsers(ProjectPermissionKey permissionKey,
                                                                  PermissionContext ctx)
Specified by:
getUsers in interface PermissionSchemeManager
Overrides:
getUsers in class DefaultPermissionSchemeManager


Copyright © 2002-2014 Atlassian. All Rights Reserved.