uk.org.ogsadai.examples.authorization
Class SimpleFileAuthorizer

java.lang.Object
  |
  +--uk.org.ogsadai.examples.authorization.SimpleFileAuthorizer
All Implemented Interfaces:
AccessAuthorizer
Direct Known Subclasses:
UpdateableFileAuthorizer

public class SimpleFileAuthorizer
extends java.lang.Object
implements AccessAuthorizer

A simple file-based implementation of the AccessAuthorizer interface which loads an access control list from a file.

Author:
The OGSA-DAI Team.

Field Summary
protected ?java.util.Map activityAuthorization
??????????Maps an activity name to a set of users that are authorized to access the activity.
protected ?java.util.Map resourceAuthorization
??????????Maps a resource ID to a set of users that are authorized to access the resource.
?
Constructor Summary
SimpleFileAuthorizer(java.lang.String?config)
??????????Constructor.
?
Method Summary
?boolean authorizeActivity(java.lang.String?resourceID, Activity?activity, SecurityContext?context)
??????????Authorizes access to an activity based on an access control list.
?boolean authorizeResource(java.lang.String?resourceID, SecurityContext?context)
??????????Authorizes access to a resource based on an access control list.
?
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
?

Field Detail

resourceAuthorization

protected java.util.Map resourceAuthorization
Maps a resource ID to a set of users that are authorized to access the resource.


activityAuthorization

protected java.util.Map activityAuthorization
Maps an activity name to a set of users that are authorized to access the activity.

Constructor Detail

SimpleFileAuthorizer

public SimpleFileAuthorizer(java.lang.String?config)
                     throws java.lang.Exception
Constructor. Populates the access control lists.

Parameters:
config - location of the configuration file
Throws:
java.lang.Exception
Method Detail

authorizeResource

public boolean authorizeResource(java.lang.String?resourceID,
                                 SecurityContext?context)
Authorizes access to a resource based on an access control list.

Specified by:
authorizeResource in interface AccessAuthorizer
Parameters:
resourceID - resource to be accessed
context - security context of the request
Returns:
boolean indicating whether the resource can be accessed within the given security context.

authorizeActivity

public boolean authorizeActivity(java.lang.String?resourceID,
                                 Activity?activity,
                                 SecurityContext?context)
Authorizes access to an activity based on an access control list. The resourceID is ignored.

Specified by:
authorizeActivity in interface AccessAuthorizer
Parameters:
resourceID - resource identifier
activity - activity object to be accessed
context - context of the request
Returns:
boolean value indicating whether access has been granted or denied.