com.atlassian.jira.permission
Class PermissionSchemeManager

java.lang.Object
  |
  +--com.atlassian.jira.scheme.AbstractSchemeManager
        |
        +--com.atlassian.jira.permission.PermissionSchemeManager
All Implemented Interfaces:
SchemeManager

public class PermissionSchemeManager
extends AbstractSchemeManager

This class is used to handle Permission Schemes. Permission Schemes are created, removed and edited through this class


Constructor Summary
PermissionSchemeManager()
           
 
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
 java.lang.String getAssociationType()
           
 java.util.List getEntities(org.ofbiz.core.entity.GenericValue scheme, java.lang.Long schemeTypeId)
          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 schemeTypeId, 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 schemeTypeId)
          Get all Generic Value permission records for a particular scheme and permission Id
 java.lang.String getEntityName()
           
 java.lang.String getSchemeDesc()
           
 java.lang.String getSchemeEntityName()
           
 boolean hasSchemeAuthority(java.lang.Long entityType, org.ofbiz.core.entity.GenericValue entity, com.opensymphony.module.user.User user)
          Checks to see if the user has any specific permissions for that permission type.
 void removeSchemesFromProject(org.ofbiz.core.entity.GenericValue project)
          Removes all permission schemes from a project
 
Methods inherited from class com.atlassian.jira.scheme.AbstractSchemeManager
addDefaultSchemeToProject, addSchemeToProject, copyScheme, createDefaultScheme, createScheme, deleteScheme, getDefaultScheme, getEntities, getEntity, getProjects, getScheme, getScheme, getSchemes, getSchemes, schemeExists, updateScheme
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PermissionSchemeManager

public PermissionSchemeManager()
Method Detail

getSchemeEntityName

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

getEntityName

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

getAssociationType

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

getSchemeDesc

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

getEntities

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

Parameters:
scheme - The scheme that the permissions belong to
schemeTypeId - 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 schemeTypeId,
                                  java.lang.String parameter)
                           throws org.ofbiz.core.entity.GenericEntityException
Get all Generic Value permission records for a particular scheme and permission Id

Parameters:
scheme - The scheme that the permissions belong to
schemeTypeId - 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.String type,
                                  java.lang.Long schemeTypeId)
                           throws org.ofbiz.core.entity.GenericEntityException
Get all Generic Value permission records for a particular scheme and permission Id

Parameters:
scheme - The scheme that the permissions belong to
type - The type of the permission(Group, Current Reporter etc)
schemeTypeId - 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
org.ofbiz.core.entity.GenericEntityException

removeSchemesFromProject

public void removeSchemesFromProject(org.ofbiz.core.entity.GenericValue project)
                              throws org.ofbiz.core.entity.GenericEntityException
Removes all permission schemes from a project

Specified by:
removeSchemesFromProject in interface SchemeManager
Overrides:
removeSchemesFromProject in class AbstractSchemeManager
Parameters:
project - The project that all permission schemes are to be deleted from
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

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
org.ofbiz.core.entity.GenericEntityException

hasSchemeAuthority

public boolean hasSchemeAuthority(java.lang.Long entityType,
                                  org.ofbiz.core.entity.GenericValue entity,
                                  com.opensymphony.module.user.User user)
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. If the user is passed in then the check is made on that user. If the user is not passed in then the check is made on the current user

Parameters:
entityType - The permission to check against
entity - The entity to check for the permission. This entity can be a project or an issue
user - The user to check for the permission. If it is not passed then the current user will be used
Returns:
true if the user has the permission otherwise false


Copyright © 2002-2003 Atlassian. All Rights Reserved.