biz.hammurapi.web.security
Class Permission

java.lang.Object
  extended bybiz.hammurapi.sql.DatabaseObject
      extended bybiz.hammurapi.web.security.sql.AssignedPermissionImpl
          extended bybiz.hammurapi.web.security.Permission
All Implemented Interfaces:
biz.hammurapi.web.security.sql.ApplicationPermission, biz.hammurapi.web.security.sql.AssignedPermission, biz.hammurapi.util.Attributable, java.lang.Cloneable, biz.hammurapi.sql.columns.ColumnChangeListener, biz.hammurapi.config.Context, biz.hammurapi.config.ContextConfigurable, biz.hammurapi.sql.DataAccessObject, biz.hammurapi.config.DomConfigurable, biz.hammurapi.xml.dom.DomSerializable, biz.hammurapi.sql.IDatabaseObject, biz.hammurapi.util.Observable, java.io.Serializable, biz.hammurapi.util.Versioned

public class Permission
extends biz.hammurapi.web.security.sql.AssignedPermissionImpl
implements biz.hammurapi.sql.DataAccessObject

This class overrides equality - it uses class name and action name instead of "helper" permission id.

Author:
Pavel Vlasov
See Also:
Serialized Form

Field Summary
 
Fields inherited from class biz.hammurapi.web.security.sql.AssignedPermissionImpl
ActionName, ClassName, Description, Id, IsDenied
 
Fields inherited from class biz.hammurapi.sql.DatabaseObject
columns, objectVersion, originalVersion
 
Constructor Summary
Permission()
           
Permission(boolean force)
           
Permission(org.w3c.dom.Element holder, boolean force)
           
Permission(org.w3c.dom.Element holder, java.util.Properties pathMap, org.apache.xpath.CachedXPathAPI cxpa, boolean force)
           
Permission(java.sql.ResultSet rs)
           
Permission(java.lang.String className, java.lang.String action)
           
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 int hashCode()
           
 boolean isDerived()
          Indicates whether permission was directly assigned to the object or derived from other objects.
 java.lang.Boolean isGranted(java.lang.String className, java.lang.String actionName)
           
 void setDerived(boolean isDerived)
          Sets derived indicator.
 void setSQLProcessor(biz.hammurapi.sql.SQLProcessor processor)
          Retrieves derived permissons
 void toDom(org.w3c.dom.Element holder)
           
 
Methods inherited from class biz.hammurapi.web.security.sql.AssignedPermissionImpl
clone, getActionName, getClassName, getDescription, getId, getIsDenied, project, project, setActionName, setClassName, setDescription, setId, setIsDenied
 
Methods inherited from class biz.hammurapi.sql.DatabaseObject
addColumn, addObserver, addRelationship, clear, configure, configure, copy, delete, fromDom, fromDom, get, getAttribute, getColumn, getColumnAttribute, getObjectVersion, getRelationship, getSqlType, insert, isDeleted, isModified, loadRelationships, onChange, removeAttribute, removeColumnAttribute, removeObserver, setAttribute, setColumnAttribute, setOriginal, toDom, toString, update
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Permission

public Permission()

Permission

public Permission(java.lang.String className,
                  java.lang.String action)

Permission

public Permission(boolean force)
Parameters:
force -

Permission

public Permission(java.sql.ResultSet rs)
           throws java.sql.SQLException
Parameters:
rs -
Throws:
java.sql.SQLException

Permission

public Permission(org.w3c.dom.Element holder,
                  boolean force)
           throws biz.hammurapi.config.ConfigurationException
Parameters:
holder -
force -
Throws:
biz.hammurapi.config.ConfigurationException

Permission

public Permission(org.w3c.dom.Element holder,
                  java.util.Properties pathMap,
                  org.apache.xpath.CachedXPathAPI cxpa,
                  boolean force)
           throws biz.hammurapi.config.ConfigurationException
Parameters:
holder -
pathMap -
cxpa -
force -
Throws:
biz.hammurapi.config.ConfigurationException
Method Detail

hashCode

public int hashCode()

equals

public boolean equals(java.lang.Object obj)

isGranted

public java.lang.Boolean isGranted(java.lang.String className,
                                   java.lang.String actionName)
Parameters:
className -
actionName -
Returns:
True if permission for given class and action is granted by this permission or permissions implied by this permission.

setDerived

public void setDerived(boolean isDerived)
Sets derived indicator.

Parameters:
isDerived -

isDerived

public boolean isDerived()
Indicates whether permission was directly assigned to the object or derived from other objects. E.g. User derives permission from Role.

Returns:

setSQLProcessor

public void setSQLProcessor(biz.hammurapi.sql.SQLProcessor processor)
                     throws java.sql.SQLException
Retrieves derived permissons

Specified by:
setSQLProcessor in interface biz.hammurapi.sql.DataAccessObject
Throws:
java.sql.SQLException

toDom

public void toDom(org.w3c.dom.Element holder)
Specified by:
toDom in interface biz.hammurapi.xml.dom.DomSerializable


Copyright © 2006 Hammurapi Group. All Rights Reserved.