August 2002
Intermediate to advanced
688 pages
23h
English
<ora:ifUserInRole>
The <ora:ifUserInRole>
action tests if the user authenticated for the request belongs to the
specified role. If so, its body is evaluated, or the Boolean test
result is saved in the specified variable. Note that this action
works only with container-provides authentication, using the security
roles declared in the application deployment descriptor.
<ora:ifUserInRole value="roleName"> Evaluated if the current user belongs toroleName</ora:ifUserInRole>
<ora:ifUserInRole value="roleName" var="var" [scope="page|request|session|application"] />
|
Attributename |
Java type |
Dynamic valueaccepted |
Description |
|---|---|---|---|
value |
String |
EL expression |
The role name |
var |
String |
No |
The name of the variable |
scope |
String |
No |
Scope for the variable |
<%-- Evaluate the body if the current user belongs to the "admin" role --%> <ora:ifUserInRole value="admin"> You're an admin </ora:ifUserInRole> <%-- Save true in the isAdmin variable if the current user belongs to the "admin" role --%> <ora:ifUserInRole value="admin" var="isAdmin" />
Read now
Unlock full access