com.atlassian.jira.issue.security
Class IssueSecuritySchemeManagerImpl

java.lang.Object
  extended by com.atlassian.jira.scheme.AbstractSchemeManager
      extended by com.atlassian.jira.issue.security.IssueSecuritySchemeManagerImpl
All Implemented Interfaces:
IssueSecuritySchemeManager, SchemeManager

public class IssueSecuritySchemeManagerImpl
extends AbstractSchemeManager
implements IssueSecuritySchemeManager


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
IssueSecuritySchemeManagerImpl(ProjectManager projectManager, PermissionTypeManager permissionTypeManager, PermissionContextFactory permissionContextFactory, SchemeFactory schemeFactory)
           
 
Method Summary
 org.ofbiz.core.entity.GenericValue copyScheme(org.ofbiz.core.entity.GenericValue scheme)
          This method overrides the AbstractSchemeManager because within Issue Security schemes there is an extra level, which is the table that holds the Security Levels for that Scheme.
 org.ofbiz.core.entity.GenericValue copySchemeEntity(org.ofbiz.core.entity.GenericValue scheme, org.ofbiz.core.entity.GenericValue entity)
           
 org.ofbiz.core.entity.GenericValue createScheme(String name, String description)
          Creates a new scheme
 org.ofbiz.core.entity.GenericValue createSchemeEntity(org.ofbiz.core.entity.GenericValue scheme, SchemeEntity schemeEntity)
           
 void deleteEntity(Long id)
          Deletes an entity from the database
 void deleteScheme(Long id)
          Deletes a scheme from the database
protected  void flushProjectSchemes()
           
 String getAssociationType()
           
 List getEntities(org.ofbiz.core.entity.GenericValue scheme)
          Get all Scheme entity records for a particular scheme
 List getEntities(org.ofbiz.core.entity.GenericValue scheme, Long entityTypeId)
           
 List getEntities(org.ofbiz.core.entity.GenericValue scheme, Long schemeTypeId, String parameter)
          Get all Generic Value permission records for a particular scheme and permission Id
 List getEntities(org.ofbiz.core.entity.GenericValue scheme, String entityTypeId)
           
 List getEntities(org.ofbiz.core.entity.GenericValue scheme, String type, Long schemeTypeId)
          Get all Generic Value issue security records for a particular scheme, type and Id
 List getEntitiesBySecurityLevel(Long securityLevelId)
           
 String getEntityName()
           
 String getSchemeDesc()
           
 String getSchemeEntityName()
           
 Collection getSchemesContainingEntity(String type, String parameter)
          This is a method that is meant to quickly get you all the schemes that contain an entity of the specified type and parameter.
 boolean hasSchemeAuthority(Long entityType, org.ofbiz.core.entity.GenericValue entity)
           
 boolean hasSchemeAuthority(Long entityType, org.ofbiz.core.entity.GenericValue issue, User user, boolean issueCreation)
          Checks to see if the user has access to issues of this security level.
 boolean removeEntities(org.ofbiz.core.entity.GenericValue scheme, Long entityTypeId)
          Retrieves all the entites for this permissio and then removes them.
 boolean removeEntities(String type, String parameter)
          This method overrides the super implemntation in order to clear cache.
 
Methods inherited from class com.atlassian.jira.scheme.AbstractSchemeManager
addDefaultSchemeToProject, addSchemeToProject, addSchemeToProject, createDefaultScheme, createSchemeAndEntities, getAssociatedSchemes, getDefaultScheme, getEntities, getEntity, getGroups, getProjectAndValidate, getProjects, getProjects, getScheme, getScheme, getSchemes, getSchemes, getUnassociatedSchemes, 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.scheme.SchemeManager
addDefaultSchemeToProject, addSchemeToProject, addSchemeToProject, createDefaultScheme, createSchemeAndEntities, getAssociatedSchemes, getDefaultScheme, getEntities, getEntity, getGroups, getProjects, getProjects, getScheme, getScheme, getSchemes, getSchemes, getUnassociatedSchemes, getUsers, getUsers, removeSchemesFromProject, removeSchemesFromProject, schemeExists, updateScheme, updateScheme
 

Constructor Detail

IssueSecuritySchemeManagerImpl

public IssueSecuritySchemeManagerImpl(ProjectManager projectManager,
                                      PermissionTypeManager permissionTypeManager,
                                      PermissionContextFactory permissionContextFactory,
                                      SchemeFactory schemeFactory)
Method Detail

getSchemeEntityName

public String getSchemeEntityName()
Specified by:
getSchemeEntityName in class AbstractSchemeManager

getEntityName

public String getEntityName()
Specified by:
getEntityName in class AbstractSchemeManager

getAssociationType

public String getAssociationType()
Specified by:
getAssociationType in class AbstractSchemeManager

getSchemeDesc

public String getSchemeDesc()
Specified by:
getSchemeDesc in class AbstractSchemeManager

getEntities

public List getEntities(org.ofbiz.core.entity.GenericValue scheme)
                 throws org.ofbiz.core.entity.GenericEntityException
Description copied from class: AbstractSchemeManager
Get all Scheme entity records for a particular scheme

Specified by:
getEntities in interface SchemeManager
Overrides:
getEntities in class AbstractSchemeManager
Parameters:
scheme - The scheme that the entities belong to
Returns:
List of (GenericValue) entities
Throws:
org.ofbiz.core.entity.GenericEntityException

getEntities

public List getEntities(org.ofbiz.core.entity.GenericValue scheme,
                        Long entityTypeId)
                 throws org.ofbiz.core.entity.GenericEntityException
Specified by:
getEntities in interface SchemeManager
Throws:
org.ofbiz.core.entity.GenericEntityException

getEntitiesBySecurityLevel

public List getEntitiesBySecurityLevel(Long securityLevelId)
                                throws org.ofbiz.core.entity.GenericEntityException
Specified by:
getEntitiesBySecurityLevel in interface IssueSecuritySchemeManager
Throws:
org.ofbiz.core.entity.GenericEntityException

getSchemesContainingEntity

public Collection getSchemesContainingEntity(String type,
                                             String parameter)
Description copied from interface: IssueSecuritySchemeManager
This is a method that is meant to quickly get you all the schemes that contain an entity of the specified type and parameter.

Specified by:
getSchemesContainingEntity in interface IssueSecuritySchemeManager
Parameters:
type - is the entity type
parameter - is the scheme entries parameter value
Returns:
Collection of GenericValues that represents a scheme

getEntities

public List getEntities(org.ofbiz.core.entity.GenericValue scheme,
                        Long schemeTypeId,
                        String parameter)
                 throws org.ofbiz.core.entity.GenericEntityException
Get all Generic Value permission records for a particular scheme and permission Id

Specified by:
getEntities in interface SchemeManager
Parameters:
scheme - The scheme that the permissions belong to
schemeTypeId - The Id of the permission
parameter - The permission parameter (group name etc)
Returns:
List of (GenericValue) permissions
Throws:
org.ofbiz.core.entity.GenericEntityException

getEntities

public List getEntities(org.ofbiz.core.entity.GenericValue scheme,
                        String entityTypeId)
                 throws org.ofbiz.core.entity.GenericEntityException
Specified by:
getEntities in interface SchemeManager
Throws:
org.ofbiz.core.entity.GenericEntityException

getEntities

public List getEntities(org.ofbiz.core.entity.GenericValue scheme,
                        String type,
                        Long schemeTypeId)
                 throws org.ofbiz.core.entity.GenericEntityException
Get all Generic Value issue security records for a particular scheme, type and Id

Specified by:
getEntities in interface SchemeManager
Parameters:
scheme - The scheme that the permissions belong to
type - The type of the permission(Group, Current Reporter etc)
schemeTypeId - The Id of the permission
Returns:
List of (GenericValue) permissions
Throws:
org.ofbiz.core.entity.GenericEntityException

createSchemeEntity

public org.ofbiz.core.entity.GenericValue createSchemeEntity(org.ofbiz.core.entity.GenericValue scheme,
                                                             SchemeEntity schemeEntity)
                                                      throws org.ofbiz.core.entity.GenericEntityException
Specified by:
createSchemeEntity in interface SchemeManager
Throws:
org.ofbiz.core.entity.GenericEntityException

copySchemeEntity

public org.ofbiz.core.entity.GenericValue copySchemeEntity(org.ofbiz.core.entity.GenericValue scheme,
                                                           org.ofbiz.core.entity.GenericValue entity)
                                                    throws org.ofbiz.core.entity.GenericEntityException
Specified by:
copySchemeEntity in class AbstractSchemeManager
Throws:
org.ofbiz.core.entity.GenericEntityException

copyScheme

public org.ofbiz.core.entity.GenericValue copyScheme(org.ofbiz.core.entity.GenericValue scheme)
                                              throws org.ofbiz.core.entity.GenericEntityException
This method overrides the AbstractSchemeManager because within Issue Security schemes there is an extra level, which is the table that holds the Security Levels for that Scheme. This is because with Issue Security schemes you can add and delete the different levels of security. With other schemes this is not possible

Specified by:
copyScheme in interface SchemeManager
Overrides:
copyScheme in class AbstractSchemeManager
Parameters:
scheme - The permission scheme to be copied
Returns:
The new permission scheme
Throws:
org.ofbiz.core.entity.GenericEntityException

hasSchemeAuthority

public boolean hasSchemeAuthority(Long entityType,
                                  org.ofbiz.core.entity.GenericValue entity)
Specified by:
hasSchemeAuthority in interface SchemeManager

hasSchemeAuthority

public boolean hasSchemeAuthority(Long entityType,
                                  org.ofbiz.core.entity.GenericValue issue,
                                  User user,
                                  boolean issueCreation)
Checks to see if the user has access to issues of this security level. If the user is not passed in then the check is made on the current user

Specified by:
hasSchemeAuthority in interface SchemeManager
Parameters:
entityType - The security level to check against
issue - The issue
user - The user to check for the permission. User must NOT be null
issueCreation -
Returns:
true if the user is a member of the security level otherwise false

deleteScheme

public void deleteScheme(Long id)
                  throws org.ofbiz.core.entity.GenericEntityException
Deletes a scheme from the database

Specified by:
deleteScheme in interface SchemeManager
Overrides:
deleteScheme in class AbstractSchemeManager
Parameters:
id - Id of the scheme to be deleted
Throws:
org.ofbiz.core.entity.GenericEntityException

deleteEntity

public void deleteEntity(Long id)
                  throws org.ofbiz.core.entity.GenericEntityException
Description copied from class: AbstractSchemeManager
Deletes an entity from the database

Specified by:
deleteEntity in interface SchemeManager
Overrides:
deleteEntity in class AbstractSchemeManager
Parameters:
id - The id of the entity to be deleted
Throws:
org.ofbiz.core.entity.GenericEntityException

removeEntities

public boolean removeEntities(org.ofbiz.core.entity.GenericValue scheme,
                              Long entityTypeId)
                       throws RemoveException
Description copied from class: AbstractSchemeManager
Retrieves all the entites for this permissio and then removes them.

Specified by:
removeEntities in interface SchemeManager
Overrides:
removeEntities in class AbstractSchemeManager
Parameters:
scheme - to remove entites from must NOT be null
entityTypeId - to remove
Returns:
True is all the entities are removed
Throws:
RemoveException

createScheme

public org.ofbiz.core.entity.GenericValue createScheme(String name,
                                                       String description)
                                                throws org.ofbiz.core.entity.GenericEntityException
Description copied from class: AbstractSchemeManager
Creates a new scheme

Specified by:
createScheme in interface SchemeManager
Overrides:
createScheme in class AbstractSchemeManager
Parameters:
name - The name of the new scheme
description - The description of the new scheme
Returns:
The new scheme object
Throws:
org.ofbiz.core.entity.GenericEntityException

flushProjectSchemes

protected void flushProjectSchemes()
Overrides:
flushProjectSchemes in class AbstractSchemeManager

removeEntities

public boolean removeEntities(String type,
                              String parameter)
                       throws RemoveException
This method overrides the super implemntation in order to clear cache.

Specified by:
removeEntities in interface SchemeManager
Overrides:
removeEntities in class AbstractSchemeManager
Parameters:
type - type
parameter - parameter
Returns:
the original result of the call to super method
Throws:
RemoveException - if super method throws it


Copyright © 2002-2009 Atlassian. All Rights Reserved.