com.objectwave.transactSecurity
Class UserProfilePolicy

java.lang.Object
  |
  +--com.objectwave.transactSecurity.UserProfilePolicy
All Implemented Interfaces:
java.util.EventListener, ObjectAccessListener

public class UserProfilePolicy
extends java.lang.Object
implements ObjectAccessListener

Use this class to create Object level access restrictions and to process ObjectAccessed events. You would use this class to enforce Security policys. It shouldn't be used to do general security issues. Generally works like this. >>objectAccessed() Get current ExternalActorProfile. Get ObjectAccessRights Determine access allowed, throw exception if not! This class is really a raw implementation. Use appendClassProfile(Class, readProfiles, writeProfiles) to create the access lists. Examples This would force mandatory granting of write access for every object that is to be written to. userProfilePolicy.appendClassProfile(Object.class, -1, 0); Read access is granted to all profiles. Only those of profile type 2 have write access to implementors of AccessSecurityIF userProfilePolicy.appendClassProfile(AccessSecurityIF.class, -1, 2);

Version:
$Id: UserProfilePolicy.java,v 2.0 2001/06/11 16:00:04 dave_hoag Exp $
Author:
dhoag

Constructor Summary
UserProfilePolicy()
           
 
Method Summary
 void appendClassProfile(java.lang.Class c, long read, long write)
          Do a bitwise or with any existing class profiles for this class.
static void main(java.lang.String[] args)
          Test method.
 void objectAccessed(ObjectAccessEvent event)
          Called when someone is trying to access an object.
 void removeProfile(java.lang.Class c)
          Remove any access restrictions for class C.
 void setCurrentActorProfiles(long l)
          Used to establish the rights for the current ExternalActor Each bit represents a profile of the current ExternalActor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserProfilePolicy

public UserProfilePolicy()
Method Detail

main

public static void main(java.lang.String[] args)
Test method.

Parameters:
args - The command line arguments

setCurrentActorProfiles

public void setCurrentActorProfiles(long l)
Used to establish the rights for the current ExternalActor Each bit represents a profile of the current ExternalActor.

Parameters:
l - The new CurrentActorProfiles value

appendClassProfile

public void appendClassProfile(java.lang.Class c,
                               long read,
                               long write)
Do a bitwise or with any existing class profiles for this class. To start blank, first remove profile for this class.

Parameters:
read - - All profiles that have read access to Class c should be marked in this parameter.
write - - All profiles that have write access to Class c should be marked in this parameter.
c - - The class for which access rights are being established.

objectAccessed

public void objectAccessed(ObjectAccessEvent event)
Called when someone is trying to access an object.

Specified by:
objectAccessed in interface ObjectAccessListener
Parameters:
event -

removeProfile

public void removeProfile(java.lang.Class c)
Remove any access restrictions for class C. The class, 'c', has to be an Exact Match to one of the classes in the list to have any effect.

Parameters:
c -