Class IssueSecurityLevelManagerImpl
java.lang.Object
com.atlassian.jira.issue.security.IssueSecurityLevelManagerImpl
- All Implemented Interfaces:
IssueSecurityLevelManager
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) -
Method Summary
Modifier and TypeMethodDescriptionvoid
clearProjectLevels
(Project project) Clears the User security Level Map.void
Clears 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.void
deleteSecurityLevel
(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.GenericValue
getIssueSecurity
(Long id) Returns the IssueSecurityLevel with the given ID.org.ofbiz.core.entity.GenericValue
Returns 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.void
onClearCache
(ClearCacheEvent event) void
boolean
Checks 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)
-
-
Method Details
-
onClearCache
-
onEvent
-
getSchemeIssueSecurityLevels
Description copied from interface:IssueSecurityLevelManager
Returns the list of Security Levels for the given Issue Security Level Scheme.- Specified by:
getSchemeIssueSecurityLevels
in 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:IssueSecurityLevelManager
Returns the list of Security Levels for the given Issue Security Level Scheme. The elements are ordered by name.- Specified by:
getIssueSecurityLevels
in 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:IssueSecurityLevelManager
Returns the IssueSecurityLevel with the given ID.- Specified by:
getIssueSecurity
in 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:IssueSecurityLevelManager
Returns the IssueSecurityLevel with the given ID.- Specified by:
getSecurityLevel
in interfaceIssueSecurityLevelManager
- Parameters:
id
- the ID- Returns:
- the IssueSecurityLevel with the given ID.
-
createIssueSecurityLevel
Description copied from interface:IssueSecurityLevelManager
Creates an Issue Security Level with the given properties.- Specified by:
createIssueSecurityLevel
in 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:IssueSecurityLevelManager
Get the level with specified name and schemaId.- Specified by:
getSecurityLevelByNameAndSchema
in 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:IssueSecurityLevelManager
Creates an Issue Security Level with the same properties as in provided Issue Security Level.- Specified by:
createIssueSecurityLevel
in interfaceIssueSecurityLevelManager
- Parameters:
level
- The Issue security level to be created.- Returns:
- the newly created Issue Security Level
-
updateIssueSecurityLevel
Description copied from interface:IssueSecurityLevelManager
Updates the name and/or description of security level.- Specified by:
updateIssueSecurityLevel
in interfaceIssueSecurityLevelManager
- Parameters:
issueSecurityLevel
- the level to update
-
schemeIssueSecurityExists
Checks to see if the issue security exists- Specified by:
schemeIssueSecurityExists
in interfaceIssueSecurityLevelManager
- Parameters:
id
- The security Id- Returns:
- True / False
-
getIssueSecurityName
Get the name of the issue security- Specified by:
getIssueSecurityName
in interfaceIssueSecurityLevelManager
- Parameters:
id
- The security Id- Returns:
- The name of the security
-
getIssueSecurityDescription
- Specified by:
getIssueSecurityDescription
in 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:
getUsersSecurityLevels
in 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:IssueSecurityLevelManager
Get 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:
getUsersSecurityLevels
in 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:IssueSecurityLevelManager
Get 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:
getUsersSecurityLevels
in 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:IssueSecurityLevelManager
Get the different levels of security that the user can see across all projects.- Specified by:
getAllUsersSecurityLevels
in 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:IssueSecurityLevelManager
Get the different levels of security that the user can see across all projects.- Specified by:
getAllSecurityLevelsForUser
in 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:IssueSecurityLevelManager
Get all the different levels of security across all schemes.- Specified by:
getAllSecurityLevels
in 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:IssueSecurityLevelManager
Get all the different levels of security across all schemes.- Specified by:
getAllIssueSecurityLevels
in 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:IssueSecurityLevelManager
Get the different levels of security that a user can see that have the specified name.- Specified by:
getUsersSecurityLevelsByName
in 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:IssueSecurityLevelManager
Get the different levels of security that a user can see that have the specified name.- Specified by:
getSecurityLevelsForUserByName
in 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:IssueSecurityLevelManager
Get the different levels of security that have the specified name.- Specified by:
getSecurityLevelsByName
in 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:IssueSecurityLevelManager
Get the different levels of security that have the specified name.- Specified by:
getIssueSecurityLevelsByName
in 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:IssueSecurityLevelManager
Returns the default Security Level as defined in the Issue Security Level scheme for the given project.- Specified by:
getSchemeDefaultSecurityLevel
in 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:IssueSecurityLevelManager
Returns the default Security Level as defined in the Issue Security Level scheme for the given project.- Specified by:
getDefaultSecurityLevel
in 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:IssueSecurityLevelManager
Returns the IssueSecurityLevel with the given ID.- Specified by:
getIssueSecurityLevel
in interfaceIssueSecurityLevelManager
- Parameters:
id
- the ID- Returns:
- the IssueSecurityLevel with the given ID.
-
deleteSecurityLevel
Description copied from interface:IssueSecurityLevelManager
Deletes the given Issue Security Level and any child permissions.- Specified by:
deleteSecurityLevel
in 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:
clearUsersLevels
in interfaceIssueSecurityLevelManager
-
clearProjectLevels
Clears the User security Level Map. This is done when security records are added or deleted- Specified by:
clearProjectLevels
in interfaceIssueSecurityLevelManager
-
getIssueCount
Description copied from interface:IssueSecurityLevelManager
Get the count of issues at the given security level for a project.- Specified by:
getIssueCount
in interfaceIssueSecurityLevelManager
- Parameters:
issueSecurityLevelId
- Issue Security LevelprojectId
- Project- Returns:
- count of issues at the given security level for a project.
-