|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.jira.scheme.AbstractSchemeManager com.atlassian.jira.permission.DefaultPermissionSchemeManager
public class DefaultPermissionSchemeManager
This class is used to handle Permission Schemes.
Permission Schemes are created, removed and edited through this class
Field Summary |
---|
Fields inherited from class com.atlassian.jira.scheme.AbstractSchemeManager |
---|
eventPublisher, projectManager, schemeFactory, securityTypeManager |
Fields inherited from interface com.atlassian.jira.scheme.SchemeManager |
---|
PROJECT_ASSOCIATION |
Constructor Summary | |
---|---|
DefaultPermissionSchemeManager(ProjectManager projectManager,
PermissionTypeManager permissionTypeManager,
PermissionContextFactory permissionContextFactory,
OfBizDelegator delegator,
SchemeFactory schemeFactory,
NodeAssociationStore nodeAssociationStore,
GroupManager groupManager,
com.atlassian.event.api.EventPublisher eventPublisher,
com.atlassian.cache.CacheManager cacheManager)
|
Method Summary | |
---|---|
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)
Create a new permission record in the database |
protected AbstractSchemeEntityEvent |
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 |
deleteEntity(Long id)
Deletes a permission from the database |
void |
deleteScheme(Long id)
Deletes a scheme from the database |
void |
flushSchemeEntities()
|
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 permissionId)
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,
Long permissionId,
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,
Long permissionId,
String type,
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)
|
List<org.ofbiz.core.entity.GenericValue> |
getEntities(org.ofbiz.core.entity.GenericValue scheme,
String type,
Long permissionId)
Get all Generic Value permission records for a particular scheme and permission Id |
String |
getEntityName()
|
Collection<com.atlassian.crowd.embedded.api.Group> |
getGroups(Long entityTypeId,
org.ofbiz.core.entity.GenericValue project)
|
Collection<com.atlassian.crowd.embedded.api.Group> |
getGroups(Long entityTypeId,
Project project)
|
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 |
hasSchemeAuthority(Long permissionId,
org.ofbiz.core.entity.GenericValue project)
Checks to see if there is an anyone permission for that permission type. |
boolean |
hasSchemeAuthority(Long permissionId,
org.ofbiz.core.entity.GenericValue project,
com.atlassian.crowd.embedded.api.User user,
boolean issueCreation)
Checks to see if the user has any specific permissions for that permission type. |
protected SchemeEntity |
makeSchemeEntity(org.ofbiz.core.entity.GenericValue entity)
|
void |
onClearCache(ClearCacheEvent event)
|
boolean |
removeEntities(org.ofbiz.core.entity.GenericValue scheme,
Long permissionId)
Retrieves all the entites for this permission and then removes them. |
boolean |
removeEntities(String type,
String parameter)
Removes all scheme entities with this parameter |
void |
start()
Registers this CachingFieldConfigContextPersister's cache in the JIRA instrumentation. |
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.permission.PermissionSchemeManager |
---|
getAssociationType |
Constructor Detail |
---|
public DefaultPermissionSchemeManager(ProjectManager projectManager, PermissionTypeManager permissionTypeManager, PermissionContextFactory permissionContextFactory, OfBizDelegator delegator, SchemeFactory schemeFactory, NodeAssociationStore nodeAssociationStore, GroupManager groupManager, com.atlassian.event.api.EventPublisher eventPublisher, com.atlassian.cache.CacheManager cacheManager)
Method Detail |
---|
public void start() throws Exception
start
in interface Startable
Exception
public void onClearCache(ClearCacheEvent event)
onClearCache
in class AbstractSchemeManager
public String getSchemeEntityName()
getSchemeEntityName
in interface PermissionSchemeManager
getSchemeEntityName
in class AbstractSchemeManager
public String getEntityName()
getEntityName
in interface PermissionSchemeManager
getEntityName
in class AbstractSchemeManager
public String getSchemeDesc()
getSchemeDesc
in interface PermissionSchemeManager
getSchemeDesc
in class AbstractSchemeManager
public String getDefaultNameKey()
getDefaultNameKey
in class AbstractSchemeManager
public String getDefaultDescriptionKey()
getDefaultDescriptionKey
in class AbstractSchemeManager
protected AbstractSchemeEvent createSchemeCreatedEvent(Scheme scheme)
createSchemeCreatedEvent
in class AbstractSchemeManager
protected AbstractSchemeCopiedEvent createSchemeCopiedEvent(@Nonnull Scheme oldScheme, @Nonnull Scheme newScheme)
createSchemeCopiedEvent
in class AbstractSchemeManager
protected AbstractSchemeUpdatedEvent createSchemeUpdatedEvent(Scheme scheme, Scheme originalScheme)
createSchemeUpdatedEvent
in class AbstractSchemeManager
public void deleteScheme(Long id) throws org.ofbiz.core.entity.GenericEntityException
SchemeManager
deleteScheme
in interface SchemeManager
deleteScheme
in class AbstractSchemeManager
id
- Id of the scheme to be deleted
org.ofbiz.core.entity.GenericEntityException
- If a DB error occursprotected AbstractSchemeAddedToProjectEvent createSchemeAddedToProjectEvent(Scheme scheme, Project project)
createSchemeAddedToProjectEvent
in class AbstractSchemeManager
public List<org.ofbiz.core.entity.GenericValue> getEntities(org.ofbiz.core.entity.GenericValue scheme, Long permissionId) throws org.ofbiz.core.entity.GenericEntityException
getEntities
in interface SchemeManager
scheme
- The scheme that the permissions belong topermissionId
- The Id of the permission
org.ofbiz.core.entity.GenericEntityException
public List<org.ofbiz.core.entity.GenericValue> getEntities(org.ofbiz.core.entity.GenericValue scheme, Long permissionId, String parameter) throws org.ofbiz.core.entity.GenericEntityException
getEntities
in interface SchemeManager
scheme
- The scheme that the permissions belong topermissionId
- The Id of the permissionparameter
- 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, Long permissionId, String type, String parameter) throws org.ofbiz.core.entity.GenericEntityException
getEntities
in interface PermissionSchemeManager
scheme
- The scheme that the permissions belong topermissionId
- The Id of the permissionparameter
- The permission parameter (group name etc)type
- The type of the permission(Group, Current Reporter etc)
org.ofbiz.core.entity.GenericEntityException
public List<org.ofbiz.core.entity.GenericValue> getEntities(org.ofbiz.core.entity.GenericValue scheme, String type, Long permissionId) throws org.ofbiz.core.entity.GenericEntityException
getEntities
in interface SchemeManager
scheme
- The scheme that the permissions belong totype
- The type of the permission(Group, Current Reporter etc)permissionId
- The Id of the permission
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
getEntities
in interface SchemeManager
org.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
scheme
- The scheme that the permission record is associated withschemeEntity
- The scheme entity object that is to be added to the scheme
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 void deleteEntity(Long id) throws DataAccessException
deleteEntity
in interface SchemeManager
deleteEntity
in class AbstractSchemeManager
id
- The id of the permission to be deleted
DataAccessException
protected AbstractSchemeEntityEvent createSchemeEntityDeletedEvent(org.ofbiz.core.entity.GenericValue entity)
createSchemeEntityDeletedEvent
in class AbstractSchemeManager
protected SchemeEntity makeSchemeEntity(org.ofbiz.core.entity.GenericValue entity)
makeSchemeEntity
in class AbstractSchemeManager
public List<org.ofbiz.core.entity.GenericValue> getEntities(org.ofbiz.core.entity.GenericValue scheme) throws org.ofbiz.core.entity.GenericEntityException
SchemeManager
getEntities
in interface SchemeManager
getEntities
in class AbstractSchemeManager
scheme
- The scheme that the entities belong to
org.ofbiz.core.entity.GenericEntityException
- If a DB error occurspublic boolean removeEntities(String type, String parameter) throws RemoveException
removeEntities
in interface SchemeManager
removeEntities
in class AbstractSchemeManager
type
- the type of scheme entity you wish to remove 'user', 'group', 'projectrole'parameter
- must NOT be null
RemoveException
- if the delete fails (DB error)public boolean removeEntities(org.ofbiz.core.entity.GenericValue scheme, Long permissionId) throws RemoveException
removeEntities
in interface SchemeManager
removeEntities
in class AbstractSchemeManager
scheme
- to remove entites from must NOT be nullpermissionId
- to remove must NOT be a global permission
RemoveException
public boolean hasSchemeAuthority(Long permissionId, org.ofbiz.core.entity.GenericValue project)
hasSchemeAuthority
in interface SchemeManager
permissionId
- The permission to check against, must not be global permissionproject
- The entity to check for the permission. This entity must be a project
public boolean hasSchemeAuthority(Long permissionId, org.ofbiz.core.entity.GenericValue project, com.atlassian.crowd.embedded.api.User user, boolean issueCreation)
hasSchemeAuthority
in interface SchemeManager
permissionId
- The permission to check against, must not be global permissionproject
- The entity to check for the permission. This entity must be a projectuser
- The user to check for the permission. The user must NOT be nullissueCreation
- true if this call is for a "Create Issue" permission.
public Collection<com.atlassian.crowd.embedded.api.Group> getGroups(Long entityTypeId, Project project)
getGroups
in interface SchemeManager
getGroups
in class AbstractSchemeManager
public Collection<com.atlassian.crowd.embedded.api.Group> getGroups(Long entityTypeId, org.ofbiz.core.entity.GenericValue project)
getGroups
in interface SchemeManager
getGroups
in class AbstractSchemeManager
protected AbstractSchemeRemovedFromProjectEvent createSchemeRemovedFromProjectEvent(Scheme scheme, Project project)
createSchemeRemovedFromProjectEvent
in class AbstractSchemeManager
public void flushSchemeEntities()
flushSchemeEntities
in interface PermissionSchemeManager
public Collection<org.ofbiz.core.entity.GenericValue> getSchemesContainingEntity(String type, String parameter)
PermissionSchemeManager
getSchemesContainingEntity
in interface PermissionSchemeManager
type
- is the entity typeparameter
- is the scheme entries parameter value
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |