com.aurel.track.dropdowns
Class AccessBeans

java.lang.Object
  extended by com.aurel.track.dropdowns.AccessBeans
All Implemented Interfaces:
java.io.Serializable

public class AccessBeans
extends java.lang.Object
implements java.io.Serializable

This class provides an AccessBeans ArrayList mainly for managing user access rights and access to specific issues. It loads all role/project combinations for one person from table TACL in the database and stores the access rights in a hashtable for each project the key being the project id, and the value being an another map with access flag values Furthermore, this class checks to what list types a user has access in a specific project. It creates a hash set containing entries where projectid and list type id are concatenated strings.

Version:
$Revision: 1.61 $ $Date: 2008-07-18 12:26:00 $
Author:
Joerg Friedrich
See Also:
Serialized Form

Nested Class Summary
static class AccessBeans.AccessFlagMigrationIndexes
          The positional constants from the extendedAccessKey The holes are permitted between this values
static class AccessBeans.AccessFlags
          Helper class used by combining the available role flags for a user.
 
Field Summary
static char OFFVALUE
           
static char ONVALUE
           
protected  java.lang.Integer personKey
           
 
Constructor Summary
AccessBeans()
           
AccessBeans(java.lang.Integer personKey)
           
 
Method Summary
 boolean addModifyDeleteBudget(java.lang.Integer project, java.lang.Integer listType)
           
 boolean addModifyDeleteDueDates(TWorkItem tWorkItem)
          Deprecated.  
 boolean addModifyDeleteOwnHoursAndCost(java.lang.Integer project, java.lang.Integer listType)
           
static java.lang.String anyRightFilterString()
          Creates an array of like strings for extendedAccessKeys
 java.util.List filterOutNotReadable(java.util.List reportBeanList)
          Filters out the report beans for which the current user has no read rights
static int[] getGroupsAndSelf(java.lang.Integer personKey)
           
 java.util.List getListTypes(java.lang.Integer project)
          Get the listTypes, the person logged on has any right for, in a project
 java.util.List getListTypes(java.lang.String[] projectKeys)
          Deprecated. Get the listTypes, the person logged on has any right for, in a project
 java.lang.Integer getProject(TWorkItem tWorkItem)
          Get the projectID of the workItem, through the subproject (workItem.getProjectID() will not always work, because it may not be set)
 boolean haveRightOrIsManagerOrResponsible(TWorkItem tWorkItem, int right)
           
 boolean isAllowedToChange()
          Checks whether the person logged on may modify the item before this call (from JSP) a isAllowedToChange(Integer project, Integer listType) should be issued.
 boolean isAllowedToChange(TWorkItem tWorkItem)
          Deprecated. replaced with isAllowedToChange(TWorkItemBean workItemBean) Checks whether the person logged on has modify access to the item (directly or through raci role)
 boolean isAllowedToChange(TWorkItemBean workItemBean)
          Checks whether the person logged on has modify access to the item (directly or through raci role)
 boolean isAllowedToClose(TWorkItem tWorkItem)
          Deprecated. replaced with isAllowedToClose(TWorkItemBean workItemBean) Checks whether the person logged on may close the item
 boolean isAllowedToClose(TWorkItemBean workItemBean)
          Checks whether the person logged on may close the item
 boolean isAllowedToCreate()
          Whether is allowed to create new issue in at least one project Specifies whether the "New Issue" menuitem should be visible
 boolean isAllowedToCreate(java.lang.Integer project, java.lang.Integer listType)
          Whether is allowed to create new issue in a project for a listType In create phase no raci roles are involved only explicit roles count
 boolean isAllowedToRead(TWorkItemBean workItemBean)
          Checks whether the person logged on has read access to the item
 boolean isAnyRightInAnyProject()
          Whether the user has any right in any project
 boolean isExtern(java.lang.Integer project, java.lang.Integer listType)
           
 boolean isInConsultantList(java.lang.Integer project, java.lang.Integer listType)
           
 boolean isInInformantList(java.lang.Integer project, java.lang.Integer listType)
           
 boolean isInManagerList(java.lang.Integer project, java.lang.Integer listType)
           
 boolean isInResponsibleList(java.lang.Integer project, java.lang.Integer listType)
           
 boolean isProjectAdmin(java.lang.Integer project, java.lang.Integer listType)
           
static java.lang.String likeFilterString(int flagIndex)
          Creates a like string for extendedAccessKey
static java.lang.String[] likeFilterString(int[] arrFlagIndexes)
          Creates an array of like strings for extendedAccessKeys
 boolean mayAssignTaskToResponsibleOrManager(TWorkItem tWorkItem)
          Deprecated.  
 boolean mayModifyConsultantsOrInformantsOrOtherWatchers(java.lang.Integer project, java.lang.Integer listType)
           
 boolean mayViewConsultantsOrInformantsOrOtherWatchers(java.lang.Integer project, java.lang.Integer listType)
           
 void setUser(java.lang.Integer personKey)
          This method loads data from table TACL and builds the hashtables which contain entries with the project id as key and the access designator (0...9) as value for each project.
 boolean viewAllHoursAndCost(java.lang.Integer project, java.lang.Integer listType)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

personKey

protected java.lang.Integer personKey

ONVALUE

public static char ONVALUE

OFFVALUE

public static char OFFVALUE
Constructor Detail

AccessBeans

public AccessBeans()

AccessBeans

public AccessBeans(java.lang.Integer personKey)
Method Detail

getGroupsAndSelf

public static int[] getGroupsAndSelf(java.lang.Integer personKey)

setUser

public void setUser(java.lang.Integer personKey)
This method loads data from table TACL and builds the hashtables which contain entries with the project id as key and the access designator (0...9) as value for each project.

Parameters:
userKey - - the users id for which to load the ACL

likeFilterString

public static java.lang.String likeFilterString(int flagIndex)
Creates a like string for extendedAccessKey

Parameters:
flagIndex - value from AccessFlagMigrationIndexes
Returns:

likeFilterString

public static java.lang.String[] likeFilterString(int[] arrFlagIndexes)
Creates an array of like strings for extendedAccessKeys

Parameters:
arrFlagIndexes - value from AccessFlagMigrationIndexes
Returns:

anyRightFilterString

public static java.lang.String anyRightFilterString()
Creates an array of like strings for extendedAccessKeys

Parameters:
arrFlagIndexes - value from AccessFlagMigrationIndexes
Returns:

isAnyRightInAnyProject

public boolean isAnyRightInAnyProject()
Whether the user has any right in any project


isAllowedToCreate

public boolean isAllowedToCreate()
Whether is allowed to create new issue in at least one project Specifies whether the "New Issue" menuitem should be visible

Parameters:
project -
accessFlag -
Returns:

isAllowedToCreate

public boolean isAllowedToCreate(java.lang.Integer project,
                                 java.lang.Integer listType)
Whether is allowed to create new issue in a project for a listType In create phase no raci roles are involved only explicit roles count

Parameters:
project -
listType -
Returns:

isAllowedToChange

public boolean isAllowedToChange()
Checks whether the person logged on may modify the item before this call (from JSP) a isAllowedToChange(Integer project, Integer listType) should be issued. Specifies whether the "Edit" menuitem should be visible

Parameters:
item -
Returns:

isAllowedToChange

public boolean isAllowedToChange(TWorkItem tWorkItem)
Deprecated. replaced with isAllowedToChange(TWorkItemBean workItemBean) Checks whether the person logged on has modify access to the item (directly or through raci role)

Parameters:
item -
Returns:

isAllowedToChange

public boolean isAllowedToChange(TWorkItemBean workItemBean)
Checks whether the person logged on has modify access to the item (directly or through raci role)

Parameters:
item -
Returns:

isAllowedToClose

public boolean isAllowedToClose(TWorkItem tWorkItem)
Deprecated. replaced with isAllowedToClose(TWorkItemBean workItemBean) Checks whether the person logged on may close the item

Parameters:
tWorkItem -
Returns:

isAllowedToClose

public boolean isAllowedToClose(TWorkItemBean workItemBean)
Checks whether the person logged on may close the item

Parameters:
tWorkItem -
Returns:

isAllowedToRead

public boolean isAllowedToRead(TWorkItemBean workItemBean)
Checks whether the person logged on has read access to the item

Parameters:
item -
Returns:

isInManagerList

public boolean isInManagerList(java.lang.Integer project,
                               java.lang.Integer listType)

isInResponsibleList

public boolean isInResponsibleList(java.lang.Integer project,
                                   java.lang.Integer listType)

isInConsultantList

public boolean isInConsultantList(java.lang.Integer project,
                                  java.lang.Integer listType)

isInInformantList

public boolean isInInformantList(java.lang.Integer project,
                                 java.lang.Integer listType)

isProjectAdmin

public boolean isProjectAdmin(java.lang.Integer project,
                              java.lang.Integer listType)

isExtern

public boolean isExtern(java.lang.Integer project,
                        java.lang.Integer listType)

addModifyDeleteBudget

public boolean addModifyDeleteBudget(java.lang.Integer project,
                                     java.lang.Integer listType)

addModifyDeleteDueDates

public boolean addModifyDeleteDueDates(TWorkItem tWorkItem)
Deprecated. 

Parameters:
tWorkItem -
Returns:

addModifyDeleteOwnHoursAndCost

public boolean addModifyDeleteOwnHoursAndCost(java.lang.Integer project,
                                              java.lang.Integer listType)

viewAllHoursAndCost

public boolean viewAllHoursAndCost(java.lang.Integer project,
                                   java.lang.Integer listType)

mayAssignTaskToResponsibleOrManager

public boolean mayAssignTaskToResponsibleOrManager(TWorkItem tWorkItem)
Deprecated. 

Parameters:
tWorkItem -
Returns:

mayModifyConsultantsOrInformantsOrOtherWatchers

public boolean mayModifyConsultantsOrInformantsOrOtherWatchers(java.lang.Integer project,
                                                               java.lang.Integer listType)

mayViewConsultantsOrInformantsOrOtherWatchers

public boolean mayViewConsultantsOrInformantsOrOtherWatchers(java.lang.Integer project,
                                                             java.lang.Integer listType)

haveRightOrIsManagerOrResponsible

public boolean haveRightOrIsManagerOrResponsible(TWorkItem tWorkItem,
                                                 int right)

getProject

public java.lang.Integer getProject(TWorkItem tWorkItem)
Get the projectID of the workItem, through the subproject (workItem.getProjectID() will not always work, because it may not be set)

Parameters:
tWorkItem -
Returns:

filterOutNotReadable

public java.util.List filterOutNotReadable(java.util.List reportBeanList)
Filters out the report beans for which the current user has no read rights

Parameters:
reportBeanList -
Returns:

getListTypes

public java.util.List getListTypes(java.lang.Integer project)
Get the listTypes, the person logged on has any right for, in a project

Parameters:
project -
listType -
Returns:

getListTypes

public java.util.List getListTypes(java.lang.String[] projectKeys)
Deprecated. Get the listTypes, the person logged on has any right for, in a project

Parameters:
project -
listType -
Returns:


Issue Tracking with Track+: Home Page      Copyright © 2008 Trackplus. All Rights Reserved.