org.edg.security.mediumgrainedauthz
Class MediumGrainedAuthorization

java.lang.Object
  |
  +--org.edg.security.mediumgrainedauthz.MediumGrainedAuthorization

public class MediumGrainedAuthorization
extends java.lang.Object

Author:
Tuomas Nissi

Method Summary
 void check(java.lang.String methodName)
          Check if the method is allowed for this user.
protected  void checkAuthorization(java.lang.String methodName, java.util.List roles)
          Searches through the allowed methods for the given role.
protected  void init(java.util.Properties prop)
          init
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

check

public void check(java.lang.String methodName)
           throws MedAuthzException
Check if the method is allowed for this user. Gets the role from securityContext. Throws MedAuthzException if method is not allowed.

Parameters:
methodName - name of the method that the user wants to use
Throws:
MedAuthzException - if the method is not allowed

init

protected void init(java.util.Properties prop)
init


checkAuthorization

protected void checkAuthorization(java.lang.String methodName,
                                  java.util.List roles)
                           throws MedAuthzException
Searches through the allowed methods for the given role. If the method given is allowed the method returns. Otherwise throws an exception.

Parameters:
methodName - method to search for
Throws:
MedAuthzException - if the method is not allowed for the given role.