net.sf.farrago.db
Class FarragoDbSessionPrivilegeMap

java.lang.Object
  extended by net.sf.farrago.db.FarragoDbSessionPrivilegeMap
All Implemented Interfaces:
FarragoSessionPrivilegeMap

 class FarragoDbSessionPrivilegeMap
extends Object
implements FarragoSessionPrivilegeMap

FarragoDbSessionPrivilegeMap is a default implementation for FarragoSessionPrivilegeMap.

Version:
$Id: //open/dev/farrago/src/net/sf/farrago/db/FarragoDbSessionPrivilegeMap.java#7 $
Author:
John V. Sichi

Field Summary
private  Map<RefClass,Set<String>> mapTypeToSet
           
private  JmiModelView modelView
           
 
Constructor Summary
FarragoDbSessionPrivilegeMap(JmiModelView modelView)
           
 
Method Summary
 Set<String> getLegalPrivilegesForType(RefClass refClass)
          Returns a set of privileges mapped as legal for a type.
(package private)  void makeImmutable()
           
 void mapPrivilegeForType(RefClass refClass, String privilegeName, boolean isLegal, boolean includeSubclasses)
          Registers a privilege as either legal or illegal for a type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

modelView

private final JmiModelView modelView

mapTypeToSet

private final Map<RefClass,Set<String>> mapTypeToSet
Constructor Detail

FarragoDbSessionPrivilegeMap

FarragoDbSessionPrivilegeMap(JmiModelView modelView)
Method Detail

mapPrivilegeForType

public void mapPrivilegeForType(RefClass refClass,
                                String privilegeName,
                                boolean isLegal,
                                boolean includeSubclasses)
Description copied from interface: FarragoSessionPrivilegeMap
Registers a privilege as either legal or illegal for a type.

Specified by:
mapPrivilegeForType in interface FarragoSessionPrivilegeMap
Parameters:
refClass - a JMI class representing the object type (e.g. RelationalPackage.getCwmTable())
privilegeName - name of the privilege to set; standard privilege names are defined in PrivilegedActionEnum, but model extensions may define their own names as well
isLegal - if true, privilege is allowed on type; if false, attempting to grant privilege on type will result in a validator exception
includeSubclasses - if true, set privilege for refClass and all of its subclasses; if false, set privilege for refClass only

getLegalPrivilegesForType

public Set<String> getLegalPrivilegesForType(RefClass refClass)
Description copied from interface: FarragoSessionPrivilegeMap
Returns a set of privileges mapped as legal for a type.

Specified by:
getLegalPrivilegesForType in interface FarragoSessionPrivilegeMap
Parameters:
refClass - a JMI class representing the object type
Returns:
Set of privilege names

makeImmutable

void makeImmutable()