com.atlassian.jira.permission
Class DefaultPermissionSchemeManager

java.lang.Object
  extended bycom.atlassian.jira.scheme.AbstractSchemeManager
      extended bycom.atlassian.jira.permission.DefaultPermissionSchemeManager
All Implemented Interfaces:
PermissionSchemeManager, SchemeManager

public class DefaultPermissionSchemeManager
extends AbstractSchemeManager
implements PermissionSchemeManager

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
PROJECT_ASSOCIATION
 
Constructor Summary
DefaultPermissionSchemeManager()
           
 
Method Summary
 org.ofbiz.core.entity.GenericValue copySchemeEntity(org.ofbiz.core.entity.GenericValue scheme, org.ofbiz.core.entity.GenericValue entity)
           
 org.ofbiz.core.entity.GenericValue createSchemeEntity(org.ofbiz.core.entity.GenericValue scheme, SchemeEntity schemeEntity)
          Create a new permission record in the database
 void deleteEntity(java.lang.Long id)
          Deletes a permission from the database
 void flushSchemeEntities()
           
 java.lang.String getAssociationType()
           
 java.util.List getEntities(org.ofbiz.core.entity.GenericValue scheme)
          Get all Scheme entity records for a particular scheme
 java.util.List getEntities(org.ofbiz.core.entity.GenericValue scheme, java.lang.Long permissionId)
          Get all Generic Value permission records for a particular scheme and permission Id
 java.util.List getEntities(org.ofbiz.core.entity.GenericValue scheme, java.lang.Long permissionId, java.lang.String parameter)
          Get all Generic Value permission records for a particular scheme and permission Id
 java.util.List getEntities(org.ofbiz.core.entity.GenericValue scheme, java.lang.Long permissionId, java.lang.String type, java.lang.String parameter)
          Get all Generic Value permission records for a particular scheme and permission Id
 java.util.List getEntities(org.ofbiz.core.entity.GenericValue scheme, java.lang.String entityTypeId)
           
 java.util.List getEntities(org.ofbiz.core.entity.GenericValue scheme, java.lang.String type, java.lang.Long permissionId)
          Get all Generic Value permission records for a particular scheme and permission Id
 java.lang.String getEntityName()
           
 java.util.Collection getGroups(java.lang.Long entityTypeId, org.ofbiz.core.entity.GenericValue project)
           
 java.lang.String getSchemeDesc()
           
 java.lang.String getSchemeEntityName()
           
 java.util.Collection getUsers(java.lang.Long permissionId, org.ofbiz.core.entity.GenericValue projectOrIssue)
          Retrieves a list of users that have current permission in a project (e.g.
 boolean hasSchemeAuthority(java.lang.Long permissionId, org.ofbiz.core.entity.GenericValue project)
          Checks to see if there is an anyone permission for that permission type.
 boolean hasSchemeAuthority(java.lang.Long permissionId, org.ofbiz.core.entity.GenericValue project, com.opensymphony.user.User user, boolean issueCreation)
          Checks to see if the user has any specific permissions for that permission type.
 boolean removeEntities(org.ofbiz.core.entity.GenericValue scheme, java.lang.Long permissionId)
          Retrieves all the entites for this permission and then removes them.
 boolean removeEntities(java.lang.String parameter)
          Removes all scheme entities with this parameter
 
Methods inherited from class com.atlassian.jira.scheme.AbstractSchemeManager
addDefaultSchemeToProject, addSchemeToProject, copyScheme, createDefaultScheme, createScheme, deleteScheme, getDefaultScheme, getEntities, getEntity, getProjectAndValidate, getProjects, getScheme, getScheme, getSchemes, getSchemes, removeSchemesFromProject, schemeExists, updateScheme
 
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.scheme.SchemeManager
addDefaultSchemeToProject, addSchemeToProject, copyScheme, createDefaultScheme, createScheme, deleteScheme, getDefaultScheme, getEntities, getEntity, getProjects, getScheme, getScheme, getSchemes, getSchemes, removeSchemesFromProject, schemeExists, updateScheme
 

Constructor Detail

DefaultPermissionSchemeManager

public DefaultPermissionSchemeManager()
Method Detail

getSchemeEntityName

public java.lang.String getSchemeEntityName()
Specified by:
getSchemeEntityName in interface PermissionSchemeManager
Specified by:
getSchemeEntityName in class AbstractSchemeManager

getEntityName

public java.lang.String getEntityName()
Specified by:
getEntityName in interface PermissionSchemeManager
Specified by:
getEntityName in class AbstractSchemeManager

getAssociationType

public java.lang.String getAssociationType()
Specified by:
getAssociationType in interface PermissionSchemeManager
Specified by:
getAssociationType in class AbstractSchemeManager

getSchemeDesc

public java.lang.String getSchemeDesc()
Specified by:
getSchemeDesc in interface PermissionSchemeManager
Specified by:
getSchemeDesc in class AbstractSchemeManager

getEntities

public java.util.List getEntities(org.ofbiz.core.entity.GenericValue scheme,
                                  java.lang.Long permissionId)
                           throws org.ofbiz.core.entity.GenericEntityException
Get all Generic Value permission records for a particular scheme and permission Id

Specified by:
getEntities in interface SchemeManager
Parameters:
scheme - The scheme that the permissions belong to
permissionId - The Id of the permission
Returns:
List of (GenericValue) permissions
Throws:
org.ofbiz.core.entity.GenericEntityException

getEntities

public java.util.List getEntities(org.ofbiz.core.entity.GenericValue scheme,
                                  java.lang.Long permissionId,
                                  java.lang.String parameter)
                           throws org.ofbiz.core.entity.GenericEntityException
Get all Generic Value permission records for a particular scheme and permission Id

Specified by:
getEntities in interface SchemeManager
Parameters:
scheme - The scheme that the permissions belong to
permissionId - The Id of the permission
parameter - The permission parameter (group name etc)
Returns:
List of (GenericValue) permissions
Throws:
org.ofbiz.core.entity.GenericEntityException

getEntities

public java.util.List getEntities(org.ofbiz.core.entity.GenericValue scheme,
                                  java.lang.Long permissionId,
                                  java.lang.String type,
                                  java.lang.String parameter)
                           throws org.ofbiz.core.entity.GenericEntityException
Get all Generic Value permission records for a particular scheme and permission Id

Specified by:
getEntities in interface PermissionSchemeManager
Parameters:
scheme - The scheme that the permissions belong to
permissionId - The Id of the permission
parameter - The permission parameter (group name etc)
type - The type of the permission(Group, Current Reporter etc)
Returns:
List of (GenericValue) permissions
Throws:
org.ofbiz.core.entity.GenericEntityException

getEntities

public java.util.List getEntities(org.ofbiz.core.entity.GenericValue scheme,
                                  java.lang.String type,
                                  java.lang.Long permissionId)
                           throws org.ofbiz.core.entity.GenericEntityException
Get all Generic Value permission records for a particular scheme and permission Id

Specified by:
getEntities in interface SchemeManager
Parameters:
scheme - The scheme that the permissions belong to
type - The type of the permission(Group, Current Reporter etc)
permissionId - The Id of the permission
Returns:
List of (GenericValue) permissions
Throws:
org.ofbiz.core.entity.GenericEntityException

getEntities

public java.util.List getEntities(org.ofbiz.core.entity.GenericValue scheme,
                                  java.lang.String entityTypeId)
                           throws org.ofbiz.core.entity.GenericEntityException
Specified by:
getEntities in interface SchemeManager
Throws:
org.ofbiz.core.entity.GenericEntityException

createSchemeEntity

public org.ofbiz.core.entity.GenericValue createSchemeEntity(org.ofbiz.core.entity.GenericValue scheme,
                                                             SchemeEntity schemeEntity)
                                                      throws org.ofbiz.core.entity.GenericEntityException
Create a new permission record in the database

Specified by:
createSchemeEntity in interface SchemeManager
Parameters:
scheme - The scheme that the permission record is associated with
schemeEntity - The scheme entity object that is to be added to the scheme
Returns:
The permission object
Throws:
org.ofbiz.core.entity.GenericEntityException

deleteEntity

public void deleteEntity(java.lang.Long id)
                  throws org.ofbiz.core.entity.GenericEntityException
Deletes a permission from the database

Specified by:
deleteEntity in interface SchemeManager
Overrides:
deleteEntity in class AbstractSchemeManager
Parameters:
id - The id of the permission to be deleted
Throws:
org.ofbiz.core.entity.GenericEntityException

copySchemeEntity

public org.ofbiz.core.entity.GenericValue copySchemeEntity(org.ofbiz.core.entity.GenericValue scheme,
                                                           org.ofbiz.core.entity.GenericValue entity)
                                                    throws org.ofbiz.core.entity.GenericEntityException
Specified by:
copySchemeEntity in class AbstractSchemeManager
Throws:
org.ofbiz.core.entity.GenericEntityException

getEntities

public java.util.List getEntities(org.ofbiz.core.entity.GenericValue scheme)
                           throws org.ofbiz.core.entity.GenericEntityException
Description copied from class: AbstractSchemeManager
Get all Scheme entity records for a particular scheme

Specified by:
getEntities in interface SchemeManager
Overrides:
getEntities in class AbstractSchemeManager
Parameters:
scheme - The scheme that the entities belong to
Returns:
List of (GenericValue) entities
Throws:
org.ofbiz.core.entity.GenericEntityException

removeEntities

public boolean removeEntities(java.lang.String parameter)
                       throws RemoveException
Removes all scheme entities with this parameter

Specified by:
removeEntities in interface SchemeManager
Overrides:
removeEntities in class AbstractSchemeManager
Parameters:
parameter - must NOT be null
Returns:
Throws:
RemoveException

removeEntities

public boolean removeEntities(org.ofbiz.core.entity.GenericValue scheme,
                              java.lang.Long permissionId)
                       throws RemoveException
Retrieves all the entites for this permission and then removes them.

Specified by:
removeEntities in interface SchemeManager
Overrides:
removeEntities in class AbstractSchemeManager
Parameters:
scheme - to remove entites from must NOT be null
permissionId - to remove must NOT be a global permission
Returns:
True is all the entities are removed
Throws:
RemoveException

hasSchemeAuthority

public boolean hasSchemeAuthority(java.lang.Long permissionId,
                                  org.ofbiz.core.entity.GenericValue project)
Checks to see if there is an anyone permission for that permission type. Specific permissions can things such as Current Reporter, Project Lead, Single User etc.

Specified by:
hasSchemeAuthority in interface SchemeManager
Parameters:
permissionId - The permission to check against, must not be global permission
project - The entity to check for the permission. This entity must be a project
Returns:
true if the user has the permission otherwise false

hasSchemeAuthority

public boolean hasSchemeAuthority(java.lang.Long permissionId,
                                  org.ofbiz.core.entity.GenericValue project,
                                  com.opensymphony.user.User user,
                                  boolean issueCreation)
Checks to see if the user has any specific permissions for that permission type. Specific permissions can things such as Current Reporter, Project Lead, Single User etc.

Specified by:
hasSchemeAuthority in interface SchemeManager
Parameters:
permissionId - The permission to check against, must not be global permission
project - The entity to check for the permission. This entity must be a project
user - The user to check for the permission. The user must NOT be null
issueCreation -
Returns:
true if the user has the permission otherwise false

getGroups

public java.util.Collection getGroups(java.lang.Long entityTypeId,
                                      org.ofbiz.core.entity.GenericValue project)
Specified by:
getGroups in interface SchemeManager
Overrides:
getGroups in class AbstractSchemeManager

getUsers

public java.util.Collection getUsers(java.lang.Long permissionId,
                                     org.ofbiz.core.entity.GenericValue projectOrIssue)
Description copied from class: AbstractSchemeManager
Retrieves a list of users that have current permission in a project (e.g. projects schemes)

Specified by:
getUsers in interface SchemeManager
Overrides:
getUsers in class AbstractSchemeManager
Parameters:
permissionId -
projectOrIssue -
Returns:

flushSchemeEntities

public void flushSchemeEntities()
Specified by:
flushSchemeEntities in interface PermissionSchemeManager


Copyright © 2002-2005 Atlassian. All Rights Reserved.