FileDocCategorySizeDatePackage
LoggedInRoleTag.javaAPI DocExample811Wed Jun 16 14:50:24 BST 2004com.darwinsys.jsptags

LoggedInRoleTag

public class LoggedInRoleTag extends javax.servlet.jsp.tagext.BodyTagSupport
LoggedInRole - include body content if user is logged in as a user that has this "role".
version
$Id: LoggedInRoleTag.java,v 1.4 2004/06/16 18:50:24 ian Exp $

Fields Summary
private String
role
Constructors Summary
Methods Summary
public intdoStartTag()
Invoked at the start tag boundary; does the work.

		String myLabel = null;

		HttpServletRequest request = (HttpServletRequest)pageContext.getRequest();
		return request.isUserInRole(role) ? EVAL_BODY_INCLUDE : SKIP_BODY;

	
public voidsetRole(java.lang.String r)

param
r The role to check for (e.g., "admin");

		role = r;