public class IssueSecuritySchemeManagerImpl extends AbstractSchemeManager implements IssueSecuritySchemeManager, Startable, GroupConfigurable
eventPublisher, groupManager, schemeFactory, securityTypeManager
PROJECT_ASSOCIATION
Constructor and Description |
---|
IssueSecuritySchemeManagerImpl(ProjectManager projectManager,
SecurityTypeManager securityTypeManager,
PermissionContextFactory permissionContextFactory,
SchemeFactory schemeFactory,
com.atlassian.event.api.EventPublisher eventPublisher,
OfBizDelegator ofBizDelegator,
GroupManager groupManager,
NodeAssociationStore nodeAssociationStore,
com.atlassian.cache.CacheManager cacheManager,
IssueIndexingService issueIndexingService,
IssueManager issueManager,
TaskManager taskManager,
QueryDslAccessor queryDslAccessor,
I18nHelper i18nHelper) |
Modifier and Type | Method and Description |
---|---|
String |
assignSchemeToProject(Project project,
Long newSchemeId,
Map<Long,Long> oldToNewSecurityLevelMappings)
Set the issue security level scheme to be used by the given Project and map any old security levels to new ones.
|
org.ofbiz.core.entity.GenericValue |
copyScheme(org.ofbiz.core.entity.GenericValue oldScheme)
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 |
createScheme(String name,
String description)
Creates a new scheme
|
protected AbstractSchemeAddedToProjectEvent |
createSchemeAddedToProjectEvent(Scheme scheme,
Project project) |
protected AbstractSchemeCopiedEvent |
createSchemeCopiedEvent(Scheme oldScheme,
Scheme newScheme) |
protected AbstractSchemeEvent |
createSchemeCreatedEvent(Scheme scheme) |
org.ofbiz.core.entity.GenericValue |
createSchemeEntity(org.ofbiz.core.entity.GenericValue scheme,
SchemeEntity schemeEntity) |
protected Object |
createSchemeEntityDeletedEvent(org.ofbiz.core.entity.GenericValue entity) |
protected org.ofbiz.core.entity.GenericValue |
createSchemeEntityNoEvent(org.ofbiz.core.entity.GenericValue scheme,
SchemeEntity schemeEntity) |
protected AbstractSchemeRemovedFromProjectEvent |
createSchemeRemovedFromProjectEvent(Scheme scheme,
Project project) |
protected AbstractSchemeUpdatedEvent |
createSchemeUpdatedEvent(Scheme scheme,
Scheme originalScheme) |
void |
deleteEntities(Iterable<Long> ids)
Deletes a collection of entities from the database.
|
void |
deleteEntity(Long id)
Deletes an entity with the given id from the database.
|
void |
deleteScheme(Long id)
Deletes a scheme from the database
|
protected void |
flushProjectSchemes() |
String |
getDefaultDescriptionKey() |
String |
getDefaultNameKey() |
List<org.ofbiz.core.entity.GenericValue> |
getEntities(org.ofbiz.core.entity.GenericValue scheme)
Get all Scheme entity records for a particular scheme
|
List<org.ofbiz.core.entity.GenericValue> |
getEntities(org.ofbiz.core.entity.GenericValue scheme,
Long securityLevelId)
Inherited from SchemeManager.
|
List<org.ofbiz.core.entity.GenericValue> |
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<org.ofbiz.core.entity.GenericValue> |
getEntities(org.ofbiz.core.entity.GenericValue scheme,
String entityTypeId)
Inherited from SchemeManager.
|
List<org.ofbiz.core.entity.GenericValue> |
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<org.ofbiz.core.entity.GenericValue> |
getEntitiesBySecurityLevel(Long securityLevelId)
Returns the configured permissions for the given Security Level.
|
String |
getEntityName() |
IssueSecurityLevelScheme |
getIssueSecurityLevelScheme(Long issueSecuritySchemeId)
Returns the IssueSecurityLevelScheme for the given ID.
|
Collection<IssueSecurityLevelScheme> |
getIssueSecurityLevelSchemes()
Returns a list containing all defined IssueSecuritySchemes
|
List<IssueSecurityLevelPermission> |
getPermissionsBySecurityLevel(Long securityLevelId)
Returns the configured permissions for the given Security Level.
|
List<Project> |
getProjectsUsingScheme(long schemeId)
Returns all projects that use the given Issue Security Level Scheme.
|
String |
getSchemeDesc() |
String |
getSchemeEntityName() |
Collection<org.ofbiz.core.entity.GenericValue> |
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 |
hasSecurityLevelAccess(Issue issue,
ApplicationUser user)
Checks if the given user has permission to see the Issue Security Level of the given issue.
|
boolean |
isGroupUsed(com.atlassian.crowd.embedded.api.Group group)
Determine whether configuration exists for the specified
Group . |
protected SchemeEntity |
makeSchemeEntity(org.ofbiz.core.entity.GenericValue entity) |
void |
onClearCache(ClearCacheEvent event) |
boolean |
removeEntities(org.ofbiz.core.entity.GenericValue scheme,
Long entityTypeId)
Retrieves all the entites for this permission and then removes them.
|
boolean |
removeEntities(String type,
String parameter)
This method overrides the super implemntation in order to clear cache.
|
void |
setSchemeForProject(Project project,
Long schemeId)
Set the issue security level scheme to be used by the given Project.
|
void |
start()
This method will be called after the plugin system is fully initialised and all components added to the
dependency injection framework.
|
addDefaultSchemeToProject, addDefaultSchemeToProject, addSchemeToProject, addSchemeToProject, copyScheme, createDefaultScheme, createSchemeAndEntities, createSchemeGenericValue, createSchemeNoEvent, createSchemeObject, getApplicationI18n, getAssociatedSchemes, getAssociationType, getDefaultScheme, getDefaultSchemeObject, getEntities, getEntitiesByIds, getEntity, getGroups, getGroups, getNameForCopy, getProjects, getScheme, getScheme, getSchemeFor, getSchemeIdFor, getSchemeObject, getSchemeObject, getSchemeObjects, getSchemes, getSchemes, getUnassociatedSchemes, getUsers, getUsers, getUsers, getUsers, removeSchemesFromProject, removeSchemesFromProject, schemeExists, swapParameterForEntitiesOfType, updateScheme, updateScheme
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getSchemeObject
addDefaultSchemeToProject, addDefaultSchemeToProject, addSchemeToProject, addSchemeToProject, copyScheme, createDefaultScheme, createSchemeAndEntities, createSchemeObject, getAssociatedSchemes, getDefaultScheme, getDefaultSchemeObject, getEntities, getEntitiesByIds, getEntity, getGroups, getGroups, getProjects, getScheme, getScheme, getSchemeFor, getSchemeIdFor, getSchemeObject, getSchemeObjects, getSchemes, getSchemes, getUnassociatedSchemes, getUsers, getUsers, getUsers, getUsers, removeSchemesFromProject, removeSchemesFromProject, schemeExists, swapParameterForEntitiesOfType, updateScheme, updateScheme
isGroupUsed
public IssueSecuritySchemeManagerImpl(ProjectManager projectManager, SecurityTypeManager securityTypeManager, PermissionContextFactory permissionContextFactory, SchemeFactory schemeFactory, com.atlassian.event.api.EventPublisher eventPublisher, OfBizDelegator ofBizDelegator, GroupManager groupManager, NodeAssociationStore nodeAssociationStore, com.atlassian.cache.CacheManager cacheManager, IssueIndexingService issueIndexingService, IssueManager issueManager, TaskManager taskManager, QueryDslAccessor queryDslAccessor, I18nHelper i18nHelper)
public void start() throws Exception
Startable
@EventListener public void onClearCache(ClearCacheEvent event)
onClearCache
in class AbstractSchemeManager
public String getSchemeEntityName()
getSchemeEntityName
in class AbstractSchemeManager
public String getEntityName()
getEntityName
in class AbstractSchemeManager
public String getSchemeDesc()
getSchemeDesc
in class AbstractSchemeManager
public String getDefaultNameKey()
getDefaultNameKey
in class AbstractSchemeManager
public String getDefaultDescriptionKey()
getDefaultDescriptionKey
in class AbstractSchemeManager
public List<org.ofbiz.core.entity.GenericValue> getEntities(org.ofbiz.core.entity.GenericValue scheme)
SchemeManager
getEntities
in interface IssueSecuritySchemeManager
getEntities
in interface SchemeManager
getEntities
in class AbstractSchemeManager
scheme
- The scheme that the entities belong topublic List<org.ofbiz.core.entity.GenericValue> getEntities(org.ofbiz.core.entity.GenericValue scheme, Long securityLevelId) throws org.ofbiz.core.entity.GenericEntityException
IssueSecuritySchemeManager
getEntities
in interface IssueSecuritySchemeManager
getEntities
in interface SchemeManager
org.ofbiz.core.entity.GenericEntityException
public IssueSecurityLevelScheme getIssueSecurityLevelScheme(Long issueSecuritySchemeId)
IssueSecuritySchemeManager
getIssueSecurityLevelScheme
in interface IssueSecuritySchemeManager
issueSecuritySchemeId
- Scheme IDpublic Collection<IssueSecurityLevelScheme> getIssueSecurityLevelSchemes()
IssueSecuritySchemeManager
getIssueSecurityLevelSchemes
in interface IssueSecuritySchemeManager
public List<org.ofbiz.core.entity.GenericValue> getEntitiesBySecurityLevel(Long securityLevelId)
IssueSecuritySchemeManager
getEntitiesBySecurityLevel
in interface IssueSecuritySchemeManager
securityLevelId
- the Security Levelpublic List<IssueSecurityLevelPermission> getPermissionsBySecurityLevel(Long securityLevelId)
IssueSecuritySchemeManager
getPermissionsBySecurityLevel
in interface IssueSecuritySchemeManager
securityLevelId
- the Security Levelpublic Collection<org.ofbiz.core.entity.GenericValue> getSchemesContainingEntity(String type, String parameter)
IssueSecuritySchemeManager
getSchemesContainingEntity
in interface IssueSecuritySchemeManager
type
- is the entity typeparameter
- is the scheme entries parameter valuepublic void setSchemeForProject(Project project, Long schemeId)
IssueSecuritySchemeManager
setSchemeForProject
in interface IssueSecuritySchemeManager
project
- The ProjectschemeId
- The desired new security level scheme to use - null indicates "no issue security levels".public String assignSchemeToProject(@Nonnull Project project, Long newSchemeId, Map<Long,Long> oldToNewSecurityLevelMappings)
IssueSecuritySchemeManager
assignSchemeToProject
in interface IssueSecuritySchemeManager
project
- The ProjectnewSchemeId
- The desired new security level scheme to use - null indicates "no issue security levels".oldToNewSecurityLevelMappings
- Mappings of old to new security levels.
This must not contain null values. '-1' is used to represent the value "none".public List<Project> getProjectsUsingScheme(long schemeId)
IssueSecuritySchemeManager
getProjectsUsingScheme
in interface IssueSecuritySchemeManager
schemeId
- ID of the Issue Security Level Schemepublic List<org.ofbiz.core.entity.GenericValue> getEntities(org.ofbiz.core.entity.GenericValue scheme, Long schemeTypeId, String parameter) throws org.ofbiz.core.entity.GenericEntityException
getEntities
in interface IssueSecuritySchemeManager
getEntities
in interface SchemeManager
scheme
- The scheme that the permissions belong toschemeTypeId
- The security level Idparameter
- The permission parameter (group name etc)org.ofbiz.core.entity.GenericEntityException
public List<org.ofbiz.core.entity.GenericValue> getEntities(org.ofbiz.core.entity.GenericValue scheme, String entityTypeId) throws org.ofbiz.core.entity.GenericEntityException
IssueSecuritySchemeManager
getEntities
in interface IssueSecuritySchemeManager
getEntities
in interface SchemeManager
org.ofbiz.core.entity.GenericEntityException
public List<org.ofbiz.core.entity.GenericValue> getEntities(org.ofbiz.core.entity.GenericValue scheme, String type, Long schemeTypeId) throws org.ofbiz.core.entity.GenericEntityException
getEntities
in interface IssueSecuritySchemeManager
getEntities
in interface SchemeManager
scheme
- The scheme that the permissions belong totype
- The type of the permission(Group, Current Reporter etc)schemeTypeId
- The security level Idorg.ofbiz.core.entity.GenericEntityException
public org.ofbiz.core.entity.GenericValue createSchemeEntity(org.ofbiz.core.entity.GenericValue scheme, SchemeEntity schemeEntity) throws org.ofbiz.core.entity.GenericEntityException
createSchemeEntity
in interface SchemeManager
org.ofbiz.core.entity.GenericEntityException
protected org.ofbiz.core.entity.GenericValue createSchemeEntityNoEvent(org.ofbiz.core.entity.GenericValue scheme, SchemeEntity schemeEntity) throws org.ofbiz.core.entity.GenericEntityException
createSchemeEntityNoEvent
in class AbstractSchemeManager
org.ofbiz.core.entity.GenericEntityException
public org.ofbiz.core.entity.GenericValue copyScheme(org.ofbiz.core.entity.GenericValue oldScheme) throws org.ofbiz.core.entity.GenericEntityException
copyScheme
in interface SchemeManager
copyScheme
in class AbstractSchemeManager
oldScheme
- The permission scheme to be copiedorg.ofbiz.core.entity.GenericEntityException
- If a DB error occurs@Nonnull protected AbstractSchemeCopiedEvent createSchemeCopiedEvent(@Nonnull Scheme oldScheme, @Nonnull Scheme newScheme)
createSchemeCopiedEvent
in class AbstractSchemeManager
public boolean hasSecurityLevelAccess(@Nonnull Issue issue, @Nullable ApplicationUser user)
IssueSecuritySchemeManager
Note that this does not check other permissions.
hasSecurityLevelAccess
in interface IssueSecuritySchemeManager
issue
- the Issueuser
- the User (null for anonymous)protected AbstractSchemeUpdatedEvent createSchemeUpdatedEvent(Scheme scheme, Scheme originalScheme)
createSchemeUpdatedEvent
in class AbstractSchemeManager
public void deleteScheme(Long id) throws org.ofbiz.core.entity.GenericEntityException
deleteScheme
in interface SchemeManager
deleteScheme
in class AbstractSchemeManager
id
- Id of the scheme to be deletedorg.ofbiz.core.entity.GenericEntityException
public void deleteEntity(Long id) throws DataAccessException
SchemeManager
deleteEntity
in interface SchemeManager
deleteEntity
in class AbstractSchemeManager
id
- The id of the entity to be deletedDataAccessException
public void deleteEntities(Iterable<Long> ids)
SchemeManager
deleteEntities
in interface SchemeManager
deleteEntities
in class AbstractSchemeManager
ids
- a collection entity ids to be deleted.protected SchemeEntity makeSchemeEntity(org.ofbiz.core.entity.GenericValue entity)
makeSchemeEntity
in class AbstractSchemeManager
protected Object createSchemeEntityDeletedEvent(org.ofbiz.core.entity.GenericValue entity)
createSchemeEntityDeletedEvent
in class AbstractSchemeManager
public boolean removeEntities(org.ofbiz.core.entity.GenericValue scheme, Long entityTypeId) throws RemoveException
SchemeManager
removeEntities
in interface SchemeManager
removeEntities
in class AbstractSchemeManager
scheme
- to remove entites from must NOT be nullentityTypeId
- to removeRemoveException
- if the delete fails (DB error)public org.ofbiz.core.entity.GenericValue createScheme(String name, String description) throws org.ofbiz.core.entity.GenericEntityException
SchemeManager
createScheme
in interface SchemeManager
createScheme
in class AbstractSchemeManager
name
- The name of the new schemedescription
- The description of the new schemeorg.ofbiz.core.entity.GenericEntityException
- If a DB error occursprotected AbstractSchemeEvent createSchemeCreatedEvent(Scheme scheme)
createSchemeCreatedEvent
in class AbstractSchemeManager
protected void flushProjectSchemes()
flushProjectSchemes
in class AbstractSchemeManager
public boolean removeEntities(String type, String parameter) throws RemoveException
removeEntities
in interface SchemeManager
removeEntities
in class AbstractSchemeManager
type
- typeparameter
- parameterRemoveException
- if super method throws it@Nonnull protected AbstractSchemeAddedToProjectEvent createSchemeAddedToProjectEvent(Scheme scheme, Project project)
createSchemeAddedToProjectEvent
in class AbstractSchemeManager
@Nonnull protected AbstractSchemeRemovedFromProjectEvent createSchemeRemovedFromProjectEvent(Scheme scheme, Project project)
createSchemeRemovedFromProjectEvent
in class AbstractSchemeManager
public boolean isGroupUsed(@Nonnull com.atlassian.crowd.embedded.api.Group group)
GroupConfigurable
Group
.isGroupUsed
in interface GroupConfigurable
group
- that may or may not exist.Copyright © 2002-2023 Atlassian. All Rights Reserved.