org.kuali.hr.time.roles
Class TkUserRoles

java.lang.Object
  extended by org.kuali.hr.time.roles.TkUserRoles
All Implemented Interfaces:
UserRoles

public class TkUserRoles
extends Object
implements UserRoles

TkUserRoles encapsulates the concept of roles for a single user and provides lookup methods for quick Role checking. This object will be stored in TkUser.


Method Summary
 boolean canSubmitTimesheet(String docId)
           
 boolean canSubmitTimesheet(TimesheetDocument doc)
           
 Set<String> getActiveAssignmentIds()
          Accessor method to obtain the Set of active Assignment ids for the current employee.
 Set<Long> getApproverWorkAreas()
          Provides a set of WorkArea names that this user is an approver for.
 Set<String> getDepartmentViewOnlyDepartments()
          Provides a Set of Department names that this user is a departmental view only for.
 Set<String> getOrgAdminCharts()
          Provides a Set of chart names that this user is a chart administrator for.
 Set<String> getOrgAdminDepartments()
          Provides a Set of Department names that this user is a chart administrator for.
 String getPrincipalId()
           
 Set<Long> getReviewerWorkAreas()
          Provides a Set of WorkArea names that this user is a reviewer for.
static TkUserRoles getUserRoles(String principalId)
           
 boolean isActiveEmployee()
          Does the current user have any active assignments?
 boolean isAnyApproverActive()
          Does the current user have any active approver roles? Approver roles attach at the WorkArea level.
 boolean isApprover()
           
 boolean isApproverForPerson(String principalId)
           
 boolean isApproverForTimesheet(String docId)
           
 boolean isApproverForTimesheet(TimesheetDocument doc)
          Indicates whether or not the current can approve the provided timesheet.
 boolean isDepartmentAdmin()
           
 boolean isDepartmentAdminForPerson(String principalId)
           
 boolean isDeptViewOnly()
           
 boolean isDeptViewOnlyForPerson(String principalId)
           
 boolean isDocumentReadable(String documentId)
           
 boolean isDocumentReadable(TimesheetDocument document)
           
 boolean isDocumentWritable(String documentId)
           
 boolean isDocumentWritable(TimesheetDocument document)
           
 boolean isGlobalViewOnly()
          Does the current user have the Global View Only role?
 boolean isLocationAdmin()
           
 boolean isLocationAdminForPerson(String principalId)
           
 boolean isReviewer()
           
 boolean isSynchronous()
          Does the current user have an assignment that is marked synchronous?
 boolean isSystemAdmin()
          Is the current user a system administrator?
 boolean isTimesheetApprover()
          Does the current user have any role that grants permission to approve timesheets?
 boolean isTimesheetReviewer()
           
 boolean isTimesheetReviewerForPerson(String principalId)
           
 void setAssignments(List<Assignment> assignments)
           
 void setPrincipalId(String principalId)
           
 void setRoles(List<TkRole> roles)
          Place the TkRole objects in the provided List into their appropriate buckets for fast lookup.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getUserRoles

public static TkUserRoles getUserRoles(String principalId)

isLocationAdmin

public boolean isLocationAdmin()
Specified by:
isLocationAdmin in interface UserRoles

isDepartmentAdmin

public boolean isDepartmentAdmin()
Specified by:
isDepartmentAdmin in interface UserRoles

getPrincipalId

public String getPrincipalId()
Specified by:
getPrincipalId in interface UserRoles

setPrincipalId

public void setPrincipalId(String principalId)

getApproverWorkAreas

public Set<Long> getApproverWorkAreas()
Description copied from interface: UserRoles
Provides a set of WorkArea names that this user is an approver for.

Specified by:
getApproverWorkAreas in interface UserRoles
Returns:
a Set of workarea names.

getReviewerWorkAreas

public Set<Long> getReviewerWorkAreas()
Description copied from interface: UserRoles
Provides a Set of WorkArea names that this user is a reviewer for.

Specified by:
getReviewerWorkAreas in interface UserRoles
Returns:
a Set of workarea names.

getOrgAdminDepartments

public Set<String> getOrgAdminDepartments()
Description copied from interface: UserRoles
Provides a Set of Department names that this user is a chart administrator for.

Specified by:
getOrgAdminDepartments in interface UserRoles
Returns:
a Set of Department names.

getOrgAdminCharts

public Set<String> getOrgAdminCharts()
Description copied from interface: UserRoles
Provides a Set of chart names that this user is a chart administrator for.

Specified by:
getOrgAdminCharts in interface UserRoles
Returns:
a Set of Chart names.

getDepartmentViewOnlyDepartments

public Set<String> getDepartmentViewOnlyDepartments()
Description copied from interface: UserRoles
Provides a Set of Department names that this user is a departmental view only for.

Specified by:
getDepartmentViewOnlyDepartments in interface UserRoles
Returns:
a Set of Department names.

getActiveAssignmentIds

public Set<String> getActiveAssignmentIds()
Accessor method to obtain the Set of active Assignment ids for the current employee.

Specified by:
getActiveAssignmentIds in interface UserRoles
Returns:
a Set of active assignment IDs

isSystemAdmin

public boolean isSystemAdmin()
Description copied from interface: UserRoles
Is the current user a system administrator?

Specified by:
isSystemAdmin in interface UserRoles
Returns:
true if yes, false otherwise

isGlobalViewOnly

public boolean isGlobalViewOnly()
Description copied from interface: UserRoles
Does the current user have the Global View Only role?

Specified by:
isGlobalViewOnly in interface UserRoles
Returns:
true if yes, false otherwise.

isDeptViewOnly

public boolean isDeptViewOnly()
Specified by:
isDeptViewOnly in interface UserRoles

isSynchronous

public boolean isSynchronous()
Description copied from interface: UserRoles
Does the current user have an assignment that is marked synchronous?

Specified by:
isSynchronous in interface UserRoles
Returns:
true if yes, false otherwise.

isReviewer

public boolean isReviewer()

isApprover

public boolean isApprover()

setRoles

public void setRoles(List<TkRole> roles)
Place the TkRole objects in the provided List into their appropriate buckets for fast lookup.

Parameters:
roles - A List of TkRole objects for the current user.

setAssignments

public void setAssignments(List<Assignment> assignments)

isActiveEmployee

public boolean isActiveEmployee()
Description copied from interface: UserRoles
Does the current user have any active assignments?

Specified by:
isActiveEmployee in interface UserRoles
Returns:
true if yes, false otherwise.

isTimesheetApprover

public boolean isTimesheetApprover()
Description copied from interface: UserRoles
Does the current user have any role that grants permission to approve timesheets?

Specified by:
isTimesheetApprover in interface UserRoles
Returns:
true if yes, false otherwise.

isTimesheetReviewer

public boolean isTimesheetReviewer()
Specified by:
isTimesheetReviewer in interface UserRoles

isAnyApproverActive

public boolean isAnyApproverActive()
Description copied from interface: UserRoles
Does the current user have any active approver roles? Approver roles attach at the WorkArea level.

Specified by:
isAnyApproverActive in interface UserRoles
Returns:
true if yes, false otherwise.

isApproverForTimesheet

public boolean isApproverForTimesheet(TimesheetDocument doc)
Description copied from interface: UserRoles
Indicates whether or not the current can approve the provided timesheet.

Specified by:
isApproverForTimesheet in interface UserRoles
Parameters:
doc - The TimesheetDocument in question.
Returns:
true if the doc can be approved by the current user.

isApproverForTimesheet

public boolean isApproverForTimesheet(String docId)
Specified by:
isApproverForTimesheet in interface UserRoles

isDocumentWritable

public boolean isDocumentWritable(TimesheetDocument document)
Specified by:
isDocumentWritable in interface UserRoles

isDocumentWritable

public boolean isDocumentWritable(String documentId)
Specified by:
isDocumentWritable in interface UserRoles

isDocumentReadable

public boolean isDocumentReadable(String documentId)
Specified by:
isDocumentReadable in interface UserRoles

isDocumentReadable

public boolean isDocumentReadable(TimesheetDocument document)
Specified by:
isDocumentReadable in interface UserRoles

canSubmitTimesheet

public boolean canSubmitTimesheet(TimesheetDocument doc)
Specified by:
canSubmitTimesheet in interface UserRoles

canSubmitTimesheet

public boolean canSubmitTimesheet(String docId)
Specified by:
canSubmitTimesheet in interface UserRoles

isApproverForPerson

public boolean isApproverForPerson(String principalId)
Specified by:
isApproverForPerson in interface UserRoles

isDepartmentAdminForPerson

public boolean isDepartmentAdminForPerson(String principalId)
Specified by:
isDepartmentAdminForPerson in interface UserRoles

isDeptViewOnlyForPerson

public boolean isDeptViewOnlyForPerson(String principalId)
Specified by:
isDeptViewOnlyForPerson in interface UserRoles

isLocationAdminForPerson

public boolean isLocationAdminForPerson(String principalId)
Specified by:
isLocationAdminForPerson in interface UserRoles

isTimesheetReviewerForPerson

public boolean isTimesheetReviewerForPerson(String principalId)
Specified by:
isTimesheetReviewerForPerson in interface UserRoles


Copyright © 2004-2012 The Kuali Foundation. All Rights Reserved.