com.atlassian.jira.issue.security
Class IssueLevelSecurities

java.lang.Object
  extended by com.atlassian.jira.issue.security.IssueLevelSecurities
All Implemented Interfaces:
Startable, IssueSecurityLevelManager

public class IssueLevelSecurities
extends java.lang.Object
implements IssueSecurityLevelManager, Startable

This class gets a list of all the security that can be part of a issue security scheme


Field Summary
protected  org.apache.log4j.Logger log
           
 
Constructor Summary
IssueLevelSecurities(IssueSecuritySchemeManager issueSecuritySchemeManager, SecurityTypeManager securityTypeManager, ProjectManager projectManager, PermissionManager permissionManager, com.atlassian.event.api.EventPublisher eventPublisher)
           
 
Method Summary
 void clearProjectLevels(org.ofbiz.core.entity.GenericValue project)
          Clears the User security Level Map.
 void clearUsersLevels()
          Clears the User security Level Map.
 void deleteSecurityLevel(java.lang.Long levelId)
           
 java.util.Collection<org.ofbiz.core.entity.GenericValue> getAllSecurityLevels()
          Get all the different levels of security across all schemes.
 java.util.Collection<org.ofbiz.core.entity.GenericValue> getAllUsersSecurityLevels(com.opensymphony.user.User user)
          Get the different levels of security that the user can see across all projects.
 org.ofbiz.core.entity.GenericValue getIssueSecurity(java.lang.Long id)
           
 java.lang.String getIssueSecurityDescription(java.lang.Long id)
           
 org.ofbiz.core.entity.GenericValue getIssueSecurityLevel(java.lang.Long id)
           
 java.lang.String getIssueSecurityName(java.lang.Long id)
          Get the name of the issue security
 java.lang.Long getSchemeDefaultSecurityLevel(org.ofbiz.core.entity.GenericValue project)
           
 java.util.List<org.ofbiz.core.entity.GenericValue> getSchemeIssueSecurityLevels(java.lang.Long schemeId)
          Returns the list of Security Levels for the given Issue Security Level Scheme.
 java.util.Collection<org.ofbiz.core.entity.GenericValue> getSecurityLevelsByName(java.lang.String securityLevelName)
          Get the different levels of security that have the specified name.
 java.util.List<org.ofbiz.core.entity.GenericValue> getUsersSecurityLevels(org.ofbiz.core.entity.GenericValue entity, com.opensymphony.user.User user)
          Get the different levels of security that can be set for this issue.
 java.util.Collection<org.ofbiz.core.entity.GenericValue> getUsersSecurityLevelsByName(com.opensymphony.user.User user, java.lang.String securityLevelName)
          Get the different levels of security that a user can see that have the specified name.
 void onClearCache(ClearCacheEvent event)
           
 boolean schemeIssueSecurityExists(java.lang.Long id)
          Checks to see if the issue security exists
 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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected final org.apache.log4j.Logger log
Constructor Detail

IssueLevelSecurities

public IssueLevelSecurities(IssueSecuritySchemeManager issueSecuritySchemeManager,
                            SecurityTypeManager securityTypeManager,
                            ProjectManager projectManager,
                            PermissionManager permissionManager,
                            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)

getSchemeIssueSecurityLevels

public java.util.List<org.ofbiz.core.entity.GenericValue> getSchemeIssueSecurityLevels(java.lang.Long schemeId)
Description copied from interface: IssueSecurityLevelManager
Returns the list of Security Levels for the given Issue Security Level Scheme.

Specified by:
getSchemeIssueSecurityLevels in interface IssueSecurityLevelManager
Parameters:
schemeId - ID of the Issue Security Level Scheme.
Returns:
the list of Security Levels for the given Issue Security Level Scheme.

schemeIssueSecurityExists

public boolean schemeIssueSecurityExists(java.lang.Long id)
Checks to see if the issue security exists

Specified by:
schemeIssueSecurityExists in interface IssueSecurityLevelManager
Parameters:
id - The security Id
Returns:
True / False

getIssueSecurityName

public java.lang.String getIssueSecurityName(java.lang.Long id)
Get the name of the issue security

Specified by:
getIssueSecurityName in interface IssueSecurityLevelManager
Parameters:
id - The security Id
Returns:
The name of the security

getIssueSecurityDescription

public java.lang.String getIssueSecurityDescription(java.lang.Long id)
Specified by:
getIssueSecurityDescription in interface IssueSecurityLevelManager

getIssueSecurity

public org.ofbiz.core.entity.GenericValue getIssueSecurity(java.lang.Long id)
Specified by:
getIssueSecurity in interface IssueSecurityLevelManager

getUsersSecurityLevels

public java.util.List<org.ofbiz.core.entity.GenericValue> getUsersSecurityLevels(org.ofbiz.core.entity.GenericValue entity,
                                                                                 com.opensymphony.user.User user)
                                                                          throws org.ofbiz.core.entity.GenericEntityException
Get the different levels of security that can be set for this issue. TODO: JRA-14323 This method can return incorrect results because of a bug in caching.

When editing an Issue, then you would pass in the GenericValue for the Issue. When creating an Issue, the project is passed in.

Specified by:
getUsersSecurityLevels in interface IssueSecurityLevelManager
Parameters:
entity - This is the issue or the project that the security is being checked for
user - The user used for the security check
Returns:
an unmodifiable List containing the security levels
Throws:
org.ofbiz.core.entity.GenericEntityException

getAllUsersSecurityLevels

public java.util.Collection<org.ofbiz.core.entity.GenericValue> getAllUsersSecurityLevels(com.opensymphony.user.User user)
                                                                                   throws org.ofbiz.core.entity.GenericEntityException
Description copied from interface: IssueSecurityLevelManager
Get the different levels of security that the user can see across all projects.

Specified by:
getAllUsersSecurityLevels in interface IssueSecurityLevelManager
Parameters:
user - The user used for the security check
Returns:
list containing the security levels, can be null
Throws:
org.ofbiz.core.entity.GenericEntityException - Exception in the OFBiz persistence layer.

getAllSecurityLevels

public java.util.Collection<org.ofbiz.core.entity.GenericValue> getAllSecurityLevels()
                                                                              throws org.ofbiz.core.entity.GenericEntityException
Description copied from interface: IssueSecurityLevelManager
Get all the different levels of security across all schemes.

Specified by:
getAllSecurityLevels in interface IssueSecurityLevelManager
Returns:
list containing the security levels, can be null
Throws:
org.ofbiz.core.entity.GenericEntityException - Exception in the OFBiz persistence layer.

getUsersSecurityLevelsByName

public java.util.Collection<org.ofbiz.core.entity.GenericValue> getUsersSecurityLevelsByName(com.opensymphony.user.User user,
                                                                                             java.lang.String securityLevelName)
                                                                                      throws org.ofbiz.core.entity.GenericEntityException
Description copied from interface: IssueSecurityLevelManager
Get the different levels of security that a user can see that have the specified name.

Specified by:
getUsersSecurityLevelsByName in interface IssueSecurityLevelManager
Parameters:
user - the user
securityLevelName - the name of the security level.
Returns:
a collection of the GenericValues representing each level they can see with the specified name.
Throws:
org.ofbiz.core.entity.GenericEntityException - Exception in the OFBiz persistence layer.

getSecurityLevelsByName

public java.util.Collection<org.ofbiz.core.entity.GenericValue> getSecurityLevelsByName(java.lang.String securityLevelName)
                                                                                 throws org.ofbiz.core.entity.GenericEntityException
Description copied from interface: IssueSecurityLevelManager
Get the different levels of security that have the specified name.

Specified by:
getSecurityLevelsByName in interface IssueSecurityLevelManager
Parameters:
securityLevelName - the name of the security level.
Returns:
a collection of the GenericValues representing each level with the specified name.
Throws:
org.ofbiz.core.entity.GenericEntityException - Exception in the OFBiz persistence layer.

getSchemeDefaultSecurityLevel

public java.lang.Long getSchemeDefaultSecurityLevel(org.ofbiz.core.entity.GenericValue project)
                                             throws org.ofbiz.core.entity.GenericEntityException
Specified by:
getSchemeDefaultSecurityLevel in interface IssueSecurityLevelManager
Throws:
org.ofbiz.core.entity.GenericEntityException

getIssueSecurityLevel

public org.ofbiz.core.entity.GenericValue getIssueSecurityLevel(java.lang.Long id)
                                                         throws org.ofbiz.core.entity.GenericEntityException
Specified by:
getIssueSecurityLevel in interface IssueSecurityLevelManager
Throws:
org.ofbiz.core.entity.GenericEntityException

deleteSecurityLevel

public void deleteSecurityLevel(java.lang.Long levelId)
                         throws org.ofbiz.core.entity.GenericEntityException
Specified by:
deleteSecurityLevel in interface IssueSecurityLevelManager
Throws:
org.ofbiz.core.entity.GenericEntityException

clearUsersLevels

public void clearUsersLevels()
Clears the User security Level Map. This is done when security records are added or deleted

Specified by:
clearUsersLevels in interface IssueSecurityLevelManager

clearProjectLevels

public void clearProjectLevels(org.ofbiz.core.entity.GenericValue project)
Clears the User security Level Map. This is done when security records are added or deleted

Specified by:
clearProjectLevels in interface IssueSecurityLevelManager


Copyright © 2002-2010 Atlassian. All Rights Reserved.