org.objectweb.jonas.security.auth.spi
Class RoleBasedAuthorizationModule

java.lang.Object
  extended by org.objectweb.jonas.security.auth.spi.RoleBasedAuthorizationModule
All Implemented Interfaces:
java.lang.reflect.InvocationHandler

public class RoleBasedAuthorizationModule
extends java.lang.Object
implements java.lang.reflect.InvocationHandler

Authorizes a certain user to access a certain resource based on the role(s) of that user and that user's group(s).

Author:
S. Ali Tokmen

Method Summary
 java.lang.Object invoke(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args)
          Verifies that the invoker has the right of invoking a certain method and invokes it on the MBeanServer.
static javax.management.remote.MBeanServerForwarder newProxyInstance(java.lang.String type, java.lang.String param)
          Returns a usable MBeanServerForwarder instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

newProxyInstance

public static javax.management.remote.MBeanServerForwarder newProxyInstance(java.lang.String type,
                                                                            java.lang.String param)
Returns a usable MBeanServerForwarder instance.

Parameters:
type - MBeanServerForwarder type.
param - MBeanServerForwarder parameter, for example the access list file for the type "file".
Returns:
A usable MBeanServerForwarder instance.

invoke

public java.lang.Object invoke(java.lang.Object proxy,
                               java.lang.reflect.Method method,
                               java.lang.Object[] args)
                        throws java.lang.IllegalAccessException,
                               java.lang.reflect.InvocationTargetException
Verifies that the invoker has the right of invoking a certain method and invokes it on the MBeanServer.

Specified by:
invoke in interface java.lang.reflect.InvocationHandler
Parameters:
proxy - The proxy instance that the method was invoked on.
method - Method to invoke.
args - Arguments to give to the method.
Returns:
Result of the invocation.
Throws:
java.lang.reflect.InvocationTargetException - Problem with the invocation target.
java.lang.IllegalAccessException - If the current user is not allowed to invoke the given method.