This method can be used to determine if the add screen should be displayed.
Add Issue screen
public boolean ucAddPreDisplay (
ProblemFormParam values, // contains values of form params
HttpServletRequest request, // the servlet request
HttpServletResponse response, // the servlet response
Connection conn, // the database connection
SesameSession session) // the session object
This method returns a Boolean value to ExtraView. Database objects are sustained at this point. Changes made to the pfp will not affect them at this point. Updates dependent upon the insert should be done in ucAddPostInsert.
This example returns false, thus preventing the display of the add screen, if the user is in the "GUEST" User Role and the user's ID is either "EXTRNL_USER" or "BILL.SMITH".
public boolean ucAddPreDisplay (
ProblemFormParam values, // contains values of form params
HttpServletRequest request, // the servlet request
HttpServletResponse response, // the servlet response
Connection conn, // the database connection
SesameSession session) // the session object
{
boolean displayAdd = true;
String userId = null;
String userRole = null;
// Lookup originator's user ID and User Role,
// to prevent Add screen loading for some users when in a certain role
userId = session.getUserId();
userRole = session.getUserRole();
if ("GUEST".equals(userRole) && userId != null &&
("EXTRNL_USER".equals(userId) || "BILL.SMITH".equals(userId))) {
displayAdd = false;
}
Z.log.writeToLog(Z.log.WARN, "UC: ucAddPreDisplay - displayAdd=" + displayAdd);
return displayAdd;
}