Class IssueSecurityLevelManagerImpl
java.lang.Object
com.atlassian.jira.issue.security.IssueSecurityLevelManagerImpl
- All Implemented Interfaces:
InitializingComponent,IssueSecurityLevelManager
public class IssueSecurityLevelManagerImpl
extends Object
implements IssueSecurityLevelManager, InitializingComponent
This class gets a list of all the security that can be part of a issue security scheme
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionIssueSecurityLevelManagerImpl(IssueSecuritySchemeManager issueSecuritySchemeManager, SecurityTypeManager securityTypeManager, ProjectManager projectManager, PermissionManager permissionManager, EntityEngine entityEngine, com.atlassian.cache.CacheManager cacheManager, QueryDslAccessor queryDslAccessor, ApplicationProperties applicationProperties, com.atlassian.event.api.EventPublisher eventPublisher) -
Method Summary
Modifier and TypeMethodDescriptionvoidCalled after all the beans are constructed and the ApplicationContext is fully populated.voidclearProjectLevels(Project project) Clears the User security Level Map.voidClears the User security Level Map.createIssueSecurityLevel(long schemeId, String name, String description) Creates an Issue Security Level with the given properties.Creates an Issue Security Level with the same properties as in provided Issue Security Level.voiddeleteSecurityLevel(Long levelId) Deletes the given Issue Security Level and any child permissions.Get all the different levels of security across all schemes.Collection<org.ofbiz.core.entity.GenericValue> Get all the different levels of security across all schemes.Get the different levels of security that the user can see across all projects.Collection<org.ofbiz.core.entity.GenericValue> Get the different levels of security that the user can see across all projects.getDefaultSecurityLevel(Project project) Returns the default Security Level as defined in the Issue Security Level scheme for the given project.getIssueCount(Long issueSecurityLevelId, Long projectId) Get the count of issues at the given security level for a project.org.ofbiz.core.entity.GenericValuegetIssueSecurity(Long id) Returns the IssueSecurityLevel with the given ID.org.ofbiz.core.entity.GenericValueReturns the IssueSecurityLevel with the given ID.getIssueSecurityLevels(long schemeId) Returns the list of Security Levels for the given Issue Security Level Scheme.getIssueSecurityLevelsByName(String securityLevelName) Get the different levels of security that have the specified name.Get the name of the issue securitygetSchemeDefaultSecurityLevel(org.ofbiz.core.entity.GenericValue project) Returns the default Security Level as defined in the Issue Security Level scheme for the given project.List<org.ofbiz.core.entity.GenericValue> getSchemeIssueSecurityLevels(Long schemeId) Returns the list of Security Levels for the given Issue Security Level Scheme.getSecurityLevel(long id) Returns the IssueSecurityLevel with the given ID.getSecurityLevelByNameAndSchema(String securityLevelName, Long schemaId) Get the level with specified name and schemaId.Collection<org.ofbiz.core.entity.GenericValue> getSecurityLevelsByName(String securityLevelName) Get the different levels of security that have the specified name.getSecurityLevelsForUserByName(ApplicationUser user, String securityLevelName) Get the different levels of security that a user can see that have the specified name.getUsersSecurityLevels(Issue issue, ApplicationUser user) Get the different levels of security that can be set for this issue.getUsersSecurityLevels(Project project, ApplicationUser user) Get the different levels of security that can be set for an issue created in this project.List<org.ofbiz.core.entity.GenericValue> getUsersSecurityLevels(org.ofbiz.core.entity.GenericValue entity, ApplicationUser user) Get the different levels of security that can be set for this issue.Collection<org.ofbiz.core.entity.GenericValue> getUsersSecurityLevelsByName(ApplicationUser user, String securityLevelName) Get the different levels of security that a user can see that have the specified name.voidonClearCache(ClearCacheEvent event) voidbooleanChecks to see if the issue security existsupdateIssueSecurityLevel(IssueSecurityLevel issueSecurityLevel) Updates the name and/or description of security level.
-
Field Details
-
log
protected final org.apache.log4j.Logger log
-
-
Constructor Details
-
IssueSecurityLevelManagerImpl
public IssueSecurityLevelManagerImpl(IssueSecuritySchemeManager issueSecuritySchemeManager, SecurityTypeManager securityTypeManager, ProjectManager projectManager, PermissionManager permissionManager, EntityEngine entityEngine, com.atlassian.cache.CacheManager cacheManager, QueryDslAccessor queryDslAccessor, ApplicationProperties applicationProperties, com.atlassian.event.api.EventPublisher eventPublisher)
-
-
Method Details
-
afterInstantiation
Description copied from interface:InitializingComponentCalled after all the beans are constructed and the ApplicationContext is fully populated. Order of execution is order of bean creation, driven by InitializingComponentProcessor.- Specified by:
afterInstantiationin interfaceInitializingComponent- Throws:
Exception
-
onClearCache
-
onEvent
-
getSchemeIssueSecurityLevels
Description copied from interface:IssueSecurityLevelManagerReturns the list of Security Levels for the given Issue Security Level Scheme.- Specified by:
getSchemeIssueSecurityLevelsin interfaceIssueSecurityLevelManager- Parameters:
schemeId- ID of the Issue Security Level Scheme.- Returns:
- the list of Security Levels for the given Issue Security Level Scheme.
-
getIssueSecurityLevels
Description copied from interface:IssueSecurityLevelManagerReturns the list of Security Levels for the given Issue Security Level Scheme. The elements are ordered by name.- Specified by:
getIssueSecurityLevelsin interfaceIssueSecurityLevelManager- Parameters:
schemeId- ID of the Issue Security Level Scheme.- Returns:
- the list of Security Levels for the given Issue Security Level Scheme.
-
getIssueSecurity
Description copied from interface:IssueSecurityLevelManagerReturns the IssueSecurityLevel with the given ID.- Specified by:
getIssueSecurityin interfaceIssueSecurityLevelManager- Parameters:
id- the ID- Returns:
- the IssueSecurityLevel with the given ID. May be null if you pass an invalid id.
-
getSecurityLevel
Description copied from interface:IssueSecurityLevelManagerReturns the IssueSecurityLevel with the given ID.- Specified by:
getSecurityLevelin interfaceIssueSecurityLevelManager- Parameters:
id- the ID- Returns:
- the IssueSecurityLevel with the given ID.
-
createIssueSecurityLevel
Description copied from interface:IssueSecurityLevelManagerCreates an Issue Security Level with the given properties.- Specified by:
createIssueSecurityLevelin interfaceIssueSecurityLevelManager- Parameters:
schemeId- The Issue security scheme that this level belongs to.name- The name of the new leveldescription- an optional description- Returns:
- the newly created Issue Security Level
-
getSecurityLevelByNameAndSchema
Description copied from interface:IssueSecurityLevelManagerGet the level with specified name and schemaId.- Specified by:
getSecurityLevelByNameAndSchemain interfaceIssueSecurityLevelManager- Parameters:
securityLevelName- the name of the security level.schemaId- the id of security schema.- Returns:
- the IssueSecurityLevel with the specified name and security level if was found, null otherwise.
-
createIssueSecurityLevel
Description copied from interface:IssueSecurityLevelManagerCreates an Issue Security Level with the same properties as in provided Issue Security Level.- Specified by:
createIssueSecurityLevelin interfaceIssueSecurityLevelManager- Parameters:
level- The Issue security level to be created.- Returns:
- the newly created Issue Security Level
-
updateIssueSecurityLevel
Description copied from interface:IssueSecurityLevelManagerUpdates the name and/or description of security level.- Specified by:
updateIssueSecurityLevelin interfaceIssueSecurityLevelManager- Parameters:
issueSecurityLevel- the level to update
-
schemeIssueSecurityExists
Checks to see if the issue security exists- Specified by:
schemeIssueSecurityExistsin interfaceIssueSecurityLevelManager- Parameters:
id- The security Id- Returns:
- True / False
-
getIssueSecurityName
Get the name of the issue security- Specified by:
getIssueSecurityNamein interfaceIssueSecurityLevelManager- Parameters:
id- The security Id- Returns:
- The name of the security
-
getIssueSecurityDescription
- Specified by:
getIssueSecurityDescriptionin interfaceIssueSecurityLevelManager
-
getUsersSecurityLevels
public List<org.ofbiz.core.entity.GenericValue> getUsersSecurityLevels(org.ofbiz.core.entity.GenericValue entity, @Nullable ApplicationUser user) throws org.ofbiz.core.entity.GenericEntityException Get the different levels of security that can be set for this issue.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:
getUsersSecurityLevelsin interfaceIssueSecurityLevelManager- Parameters:
entity- This is the issue or the project that the security is being checked foruser- The user used for the security check- Returns:
- an unmodifiable List containing the security levels
- Throws:
org.ofbiz.core.entity.GenericEntityException
-
getUsersSecurityLevels
Description copied from interface:IssueSecurityLevelManagerGet the different levels of security that can be set for this issue. If you are creating a new Issue, then useIssueSecurityLevelManager.getUsersSecurityLevels(com.atlassian.jira.project.Project, ApplicationUser).- Specified by:
getUsersSecurityLevelsin interfaceIssueSecurityLevelManager- Parameters:
issue- This is the issue that the security is being checked foruser- The user used for the security check- Returns:
- list containing the security levels, can be null
- See Also:
-
getUsersSecurityLevels
Description copied from interface:IssueSecurityLevelManagerGet the different levels of security that can be set for an issue created in this project. If you are editing an existing Issue, then useIssueSecurityLevelManager.getUsersSecurityLevels(Issue, ApplicationUser).- Specified by:
getUsersSecurityLevelsin interfaceIssueSecurityLevelManager- Parameters:
project- the project that the security is being checked foruser- The user used for the security check- Returns:
- list containing the security levels, can be null
- See Also:
-
getAllUsersSecurityLevels
public Collection<org.ofbiz.core.entity.GenericValue> getAllUsersSecurityLevels(ApplicationUser user) throws org.ofbiz.core.entity.GenericEntityException Description copied from interface:IssueSecurityLevelManagerGet the different levels of security that the user can see across all projects.- Specified by:
getAllUsersSecurityLevelsin interfaceIssueSecurityLevelManager- 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.
-
getAllSecurityLevelsForUser
Description copied from interface:IssueSecurityLevelManagerGet the different levels of security that the user can see across all projects.- Specified by:
getAllSecurityLevelsForUserin interfaceIssueSecurityLevelManager- Parameters:
user- The user used for the security check- Returns:
- list containing the security levels
-
getAllSecurityLevels
public Collection<org.ofbiz.core.entity.GenericValue> getAllSecurityLevels() throws org.ofbiz.core.entity.GenericEntityExceptionDescription copied from interface:IssueSecurityLevelManagerGet all the different levels of security across all schemes.- Specified by:
getAllSecurityLevelsin interfaceIssueSecurityLevelManager- Returns:
- list containing the security levels, can be null
- Throws:
org.ofbiz.core.entity.GenericEntityException- Exception in the OFBiz persistence layer.
-
getAllIssueSecurityLevels
Description copied from interface:IssueSecurityLevelManagerGet all the different levels of security across all schemes.- Specified by:
getAllIssueSecurityLevelsin interfaceIssueSecurityLevelManager- Returns:
- list containing the security levels, can be null
-
getUsersSecurityLevelsByName
public Collection<org.ofbiz.core.entity.GenericValue> getUsersSecurityLevelsByName(ApplicationUser user, String securityLevelName) throws org.ofbiz.core.entity.GenericEntityException Description copied from interface:IssueSecurityLevelManagerGet the different levels of security that a user can see that have the specified name.- Specified by:
getUsersSecurityLevelsByNamein interfaceIssueSecurityLevelManager- Parameters:
user- the usersecurityLevelName- 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.
-
getSecurityLevelsForUserByName
public Collection<IssueSecurityLevel> getSecurityLevelsForUserByName(ApplicationUser user, String securityLevelName) Description copied from interface:IssueSecurityLevelManagerGet the different levels of security that a user can see that have the specified name.- Specified by:
getSecurityLevelsForUserByNamein interfaceIssueSecurityLevelManager- Parameters:
user- the usersecurityLevelName- the name of the security level.- Returns:
- a collection of each IssueSecurityLevel they can see with the specified name.
-
getSecurityLevelsByName
public Collection<org.ofbiz.core.entity.GenericValue> getSecurityLevelsByName(String securityLevelName) throws org.ofbiz.core.entity.GenericEntityException Description copied from interface:IssueSecurityLevelManagerGet the different levels of security that have the specified name.- Specified by:
getSecurityLevelsByNamein interfaceIssueSecurityLevelManager- 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.
-
getIssueSecurityLevelsByName
Description copied from interface:IssueSecurityLevelManagerGet the different levels of security that have the specified name.- Specified by:
getIssueSecurityLevelsByNamein interfaceIssueSecurityLevelManager- Parameters:
securityLevelName- the name of the security level.- Returns:
- a collection of the IssueSecurityLevels with the specified name.
-
getSchemeDefaultSecurityLevel
public Long getSchemeDefaultSecurityLevel(org.ofbiz.core.entity.GenericValue project) throws org.ofbiz.core.entity.GenericEntityException Description copied from interface:IssueSecurityLevelManagerReturns the default Security Level as defined in the Issue Security Level scheme for the given project.- Specified by:
getSchemeDefaultSecurityLevelin interfaceIssueSecurityLevelManager- Parameters:
project- the Project- Returns:
- the default Security Level as defined in the Issue Security Level scheme for the given project. Can be null.
- Throws:
org.ofbiz.core.entity.GenericEntityException- Exception in the OFBiz persistence layer.
-
getDefaultSecurityLevel
Description copied from interface:IssueSecurityLevelManagerReturns the default Security Level as defined in the Issue Security Level scheme for the given project.- Specified by:
getDefaultSecurityLevelin interfaceIssueSecurityLevelManager- Parameters:
project- the Project- Returns:
- the default Security Level as defined in the Issue Security Level scheme for the given project. Can be null.
-
getIssueSecurityLevel
Description copied from interface:IssueSecurityLevelManagerReturns the IssueSecurityLevel with the given ID.- Specified by:
getIssueSecurityLevelin interfaceIssueSecurityLevelManager- Parameters:
id- the ID- Returns:
- the IssueSecurityLevel with the given ID.
-
deleteSecurityLevel
Description copied from interface:IssueSecurityLevelManagerDeletes the given Issue Security Level and any child permissions.- Specified by:
deleteSecurityLevelin interfaceIssueSecurityLevelManager- Parameters:
levelId- Issue Security Level ID
-
clearUsersLevels
public void clearUsersLevels()Clears the User security Level Map. This is done when security records are added or deleted- Specified by:
clearUsersLevelsin interfaceIssueSecurityLevelManager
-
clearProjectLevels
Clears the User security Level Map. This is done when security records are added or deleted- Specified by:
clearProjectLevelsin interfaceIssueSecurityLevelManager
-
getIssueCount
Description copied from interface:IssueSecurityLevelManagerGet the count of issues at the given security level for a project.- Specified by:
getIssueCountin interfaceIssueSecurityLevelManager- Parameters:
issueSecurityLevelId- Issue Security LevelprojectId- Project- Returns:
- count of issues at the given security level for a project.
-