2008年7月15日 星期二

Check Access Right

import jr.object.JobSvc;

if (conn == null || conn.isClosed()) {
conn = null;
log.error("conn == null || conn.isClosed()");
errors.add("SystemError", new ActionMessage("hrms.error.systemError"));
forwardmapping = "result";
return mapping.findForward(forwardmapping);
}

if (!ValidateAccess.canAccessBySiteCodeServiceIdUserId(conn, siteCode, JobSvc.RCW_VIEW, userId)){
errors.add("accessrights",new ActionMessage("error.access.norights"));
saveErrors(request,errors);
if (conn == null && !conn.isClosed()) {
conn.close();
conn = null;
}
return mapping.findForward("Error");
}

沒有留言: