org.objectweb.jonas.security
Class MethodGuard

java.lang.Object
  |
  +--org.objectweb.jonas.security.MethodGuard
All Implemented Interfaces:
java.security.Guard, java.io.Serializable

public class MethodGuard
extends java.lang.Object
implements java.security.Guard, java.io.Serializable

Check if the principal role is matching the role defined for the method

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

Constructor Summary
MethodGuard(java.lang.String containerName)
          Constructor
 
Method Summary
 void add(java.lang.String methodSignature, java.lang.String[] roles)
          The roles which can access to the method
 void checkGuard(java.lang.Object methodSignature)
          Check if the role(s) of the principal match the roles of the method
 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

MethodGuard

public MethodGuard(java.lang.String containerName)
Constructor
Parameters:
containerName - name of the container
Method Detail

add

public void add(java.lang.String methodSignature,
                java.lang.String[] roles)
The roles which can access to the method
Parameters:
methodSignature - signature of the method
roles - roles required to execute themethod

checkGuard

public void checkGuard(java.lang.Object methodSignature)
                throws java.lang.SecurityException
Check if the role(s) of the principal match the roles of the method
Specified by:
checkGuard in interface java.security.Guard
Parameters:
methodSignature - signature of the method
Throws:
java.lang.SecurityException - if the access is denied

toString

public java.lang.String toString()
Method toString
Overrides:
toString in class java.lang.Object
Returns:
String a string representation of the object