|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.mycompany.expense.Rules
This class contains methods encoding the rules for how a report in the sample expense report application may be handled by the current user.
Constructor Summary | |
Rules()
|
Method Summary | |
boolean |
canAccept(java.lang.String user,
boolean isManager,
Report report)
Returns "true" if the user is a manager and the report is "submitted". |
boolean |
canDelete(java.lang.String user,
boolean isManager,
Report report)
Returns "true" if the user is the report owner and the report isn't locked. |
boolean |
canEdit(java.lang.String user,
boolean isManager,
Report report)
Returns "true" if the user is the report owner and the report isn't locked. |
boolean |
canReject(java.lang.String user,
boolean isManager,
Report report)
Returns "true" if the user is a manager and the report is "submitted". |
boolean |
canSubmit(java.lang.String user,
boolean isManager,
Report report)
Returns "true" if the user is the report owner and the report isn't locked. |
boolean |
canView(java.lang.String user,
boolean isManager,
Report report)
Returns "true" if the user is a manager or the report owner. |
boolean |
isLocked(Report report)
Returns "true" if the report is either "submitted" or "accepted". |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Rules()
Method Detail |
public boolean canEdit(java.lang.String user, boolean isManager, Report report)
public boolean canDelete(java.lang.String user, boolean isManager, Report report)
public boolean canSubmit(java.lang.String user, boolean isManager, Report report)
public boolean canAccept(java.lang.String user, boolean isManager, Report report)
public boolean canReject(java.lang.String user, boolean isManager, Report report)
public boolean canView(java.lang.String user, boolean isManager, Report report)
public boolean isLocked(Report report)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |