Methods Summary |
---|
public boolean | canAccept(java.lang.String user, boolean isManager, Report report)Returns "true" if the user is a manager and the report is
"submitted".
return isManager && report.getStatus() == Report.STATUS_SUBMITTED;
|
public 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.
return report.getOwner().equals(user) && !isLocked(report);
|
public 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.
return report.getOwner().equals(user) && !isLocked(report);
|
public boolean | canReject(java.lang.String user, boolean isManager, Report report)Returns "true" if the user is a manager and the report is
"submitted".
return isManager && report.getStatus() == Report.STATUS_SUBMITTED;
|
public 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.
return report.getOwner().equals(user) && !isLocked(report);
|
public boolean | canView(java.lang.String user, boolean isManager, Report report)Returns "true" if the user is a manager or the report owner.
return isManager || report.getOwner().equals(user);
|
public boolean | isLocked(Report report)Returns "true" if the report is either "submitted" or "accepted".
return report.getStatus() == Report.STATUS_SUBMITTED ||
report.getStatus() == Report.STATUS_ACCEPTED;
|