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
projectManager
 
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)
           
 
Method Summary
 java.util.Collection getUsers(java.lang.Long permissionId, PermissionContext ctx)
          Retrieves a list of Users that have current permission in a project (e.g.
 void onClearCache(ClearCacheEvent event)
           
 void start()
          This method wil be called after the plugin system is fully initialised and all components added to the dependency injection framework.
 
Methods inherited from class com.atlassian.jira.permission.DefaultPermissionSchemeManager
copySchemeEntity, createSchemeEntity, deleteEntity, flushSchemeEntities, getAssociationType, getDefaultDescriptionKey, getDefaultNameKey, getEntities, getEntities, getEntities, getEntities, getEntities, getEntities, getEntityName, getGroups, getSchemeDesc, getSchemeEntityName, getSchemesContainingEntity, getUsers, hasSchemeAuthority, hasSchemeAuthority, removeEntities, removeEntities
 
Methods inherited from class com.atlassian.jira.scheme.AbstractSchemeManager
addDefaultSchemeToProject, addSchemeToProject, addSchemeToProject, copyScheme, createDefaultScheme, createScheme, createSchemeAndEntities, createSchemeGenericValue, deleteScheme, flushProjectSchemes, getAssociatedSchemes, getDefaultScheme, getEntities, getEntity, getProjectAndValidate, getProjects, getProjects, getScheme, getScheme, getSchemes, getSchemes, getUnassociatedSchemes, 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.scheme.SchemeManager
addDefaultSchemeToProject, addSchemeToProject, addSchemeToProject, copyScheme, createDefaultScheme, createScheme, createSchemeAndEntities, deleteScheme, getAssociatedSchemes, getDefaultScheme, getEntities, getEntity, getProjects, getProjects, getScheme, getScheme, getSchemes, getSchemes, getUnassociatedSchemes, 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)
Method Detail

start

public void start()
           throws java.lang.Exception
Description copied from interface: Startable
This method wil be called after the plugin system is fully initialised and all components added to the dependency injection framework.

Specified by:
start in interface Startable
Throws:
java.lang.Exception - Allows implementations to throw an Exception.

onClearCache

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

getUsers

public java.util.Collection getUsers(java.lang.Long permissionId,
                                     PermissionContext ctx)
Description copied from class: AbstractSchemeManager
Retrieves a list of Users that have current permission in a project (e.g. projects schemes)

Specified by:
getUsers in interface SchemeManager
Overrides:
getUsers in class AbstractSchemeManager
Parameters:
permissionId - Permission ID.
ctx - Context for evaluating permission request. Includes issue or project object.
Returns:
A collection of User objects.


Copyright © 2002-2010 Atlassian. All Rights Reserved.