com.googlecode.fascinator.access.hibernate
Class HibernateAccessControl

java.lang.Object
  extended by com.googlecode.fascinator.access.hibernate.HibernateAccessControl
All Implemented Interfaces:
AccessControl, Plugin

public class HibernateAccessControl
extends Object
implements AccessControl

Hibernate-based access control

Author:
Shilo Banihit

Constructor Summary
HibernateAccessControl()
           
 
Method Summary
 void applySchema(AccessControlSchema newSecurity)
          Apply/store a new security implementation.
 AccessControlSchema getEmptySchema()
           
 String getId()
           
 String getName()
           
 PluginDescription getPluginDetails()
           
 List<String> getPossibilities(String field)
           
 List<String> getRoles(String recordId)
           
 List<AccessControlSchema> getSchemas(String recordId)
          Get a list of schemas that have been applied to a record.
 List<String> getUsers(String recordId)
           
 void init(File jsonFile)
           
 void init(String jsonString)
           
 void removeSchema(AccessControlSchema oldSecurity)
          Remove a security implementation.
 void shutdown()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HibernateAccessControl

public HibernateAccessControl()
Method Detail

getId

public String getId()
Specified by:
getId in interface Plugin

getName

public String getName()
Specified by:
getName in interface Plugin

getPluginDetails

public PluginDescription getPluginDetails()
Specified by:
getPluginDetails in interface Plugin

init

public void init(File jsonFile)
          throws PluginException
Specified by:
init in interface Plugin
Throws:
PluginException

init

public void init(String jsonString)
          throws PluginException
Specified by:
init in interface Plugin
Throws:
PluginException

shutdown

public void shutdown()
              throws PluginException
Specified by:
shutdown in interface Plugin
Throws:
PluginException

getEmptySchema

public AccessControlSchema getEmptySchema()
Specified by:
getEmptySchema in interface AccessControl

getSchemas

public List<AccessControlSchema> getSchemas(String recordId)
                                     throws AccessControlException
Get a list of schemas that have been applied to a record.

Specified by:
getSchemas in interface AccessControl
Parameters:
recordId - The record to retrieve information about.
Returns:
A list of access control schemas, possibly zero length.
Throws:
AccessControlException - if there was an error during retrieval.

applySchema

public void applySchema(AccessControlSchema newSecurity)
                 throws AccessControlException
Apply/store a new security implementation. The schema will already have a recordId as a property.

Specified by:
applySchema in interface AccessControl
Parameters:
newSecurity - The new schema to apply.
Throws:
AccessControlException - if storage of the schema fails.

removeSchema

public void removeSchema(AccessControlSchema oldSecurity)
                  throws AccessControlException
Remove a security implementation. The schema will already have a recordId as a property.

Specified by:
removeSchema in interface AccessControl
Parameters:
oldSecurity - The schema to remove.
Throws:
AccessControlException - if removal of the schema fails.

getRoles

public List<String> getRoles(String recordId)
                      throws AccessControlException
Specified by:
getRoles in interface AccessControl
Throws:
AccessControlException

getUsers

public List<String> getUsers(String recordId)
                      throws AccessControlException
Specified by:
getUsers in interface AccessControl
Throws:
AccessControlException

getPossibilities

public List<String> getPossibilities(String field)
                              throws AccessControlException
Specified by:
getPossibilities in interface AccessControl
Throws:
AccessControlException


Copyright © 2009-2014. All Rights Reserved.