org.objectweb.jonas.security
Class RoleGuard

java.lang.Object
  extended byorg.objectweb.jonas.security.RoleGuard
All Implemented Interfaces:
java.security.Guard

public class RoleGuard
extends java.lang.Object
implements java.security.Guard

Check access for the role-link/role-ref

Author:
Jeff Mesnil (initial developper), Florent Benoit 04/03 check if there are roles in SecurityContext

Constructor Summary
RoleGuard(java.lang.String containerName)
          Constructor
 
Method Summary
 void add(java.lang.String roleRef, java.lang.String role)
          Associate a role-ref to a role
 void checkGuard(java.lang.Object roleString)
          Check if the role(s) of the principal match the role-ref
 java.lang.String toString()
          Method toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RoleGuard

public RoleGuard(java.lang.String containerName)
Constructor

Parameters:
containerName - name of the container
Method Detail

add

public void add(java.lang.String roleRef,
                java.lang.String role)
Associate a role-ref to a role

Parameters:
roleRef - the role to associate
role - the associated role

checkGuard

public void checkGuard(java.lang.Object roleString)
                throws java.lang.SecurityException
Check if the role(s) of the principal match the role-ref

Specified by:
checkGuard in interface java.security.Guard
Parameters:
roleString - the role
Throws:
java.lang.SecurityException - if the access is denied

toString

public java.lang.String toString()
Method toString

Returns:
String a string representation of the object