1. VariableResolver. Javaクラスとして追加 package org.openntf; import java.util.List; import java.util.logging.Level; import javax.faces.context.FacesContext; import javax.faces.el.EvaluationException; import javax.faces.el.VariableResolver; import com.ibm.xsp.extlib.util.ExtLibUtil; /** * @author Paul Withers * */ public class BaseVariableResolver extends VariableResolver { private final VariableResolver delegate; public BaseVariableResolver(VariableResolver resolver) { delegate = resolver; } @SuppressWarnings( { "unchecked", "finally" }) private boolean hasRole(String roleName) { boolean retVal = false; try { List roles = ExtLibUtil.getCurrentDatabase().queryAccessRoles( ExtLibUtil.getCurrentSession().getEffectiveUserName()); if (roles.contains("[" + roleName + "]")) { retVal = true; } } catch (Exception e) { // Add error handling } finally { return retVal; } } @Override public Object resolveVariable(FacesContext context, String name) throws EvaluationException { try { if (name.length() > 6 && "userIs".equals(name.substring(0, 6))) { return hasRole(name.substring(6)); } else { return delegate.resolveVariable(context, name); } } catch (Exception e) { // Add error handling return delegate.resolveVariable(context, name); } } } 2. faces-config.xml へのコード。 AUTOGEN セクションの前に追加。 <application> <variable-resolver>uk.co.intec.BaseVariableResolver</variable-resolver> </application> 3. パージに Expression Language を追加。例えば、 #{userIsAdmin} は [Admin] のロールをユーザーが持っているかをチェックできるし、SSJS 内で次のように処理可能です。 if (userIsAdmin) doSomething();