biz.hammurapi.web.security
Class User

java.lang.Object
  extended bybiz.hammurapi.sql.DatabaseObject
      extended bybiz.hammurapi.web.security.sql.ApplicationUserImpl
          extended bybiz.hammurapi.web.security.User
All Implemented Interfaces:
biz.hammurapi.web.security.sql.ApplicationUser, 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.web.security.sql.UserIn, biz.hammurapi.util.Versioned

public class User
extends biz.hammurapi.web.security.sql.ApplicationUserImpl
implements biz.hammurapi.sql.DataAccessObject

Author:
Pavel Vlasov
See Also:
Serialized Form

Field Summary
static java.lang.String ADMIN_NAME
           
 
Fields inherited from class biz.hammurapi.web.security.sql.ApplicationUserImpl
EMail, FirstName, IsBlocked, LastName, LastPasswordChange, LoginName, MenuId, Notes, Phone, UnmatchedBehavior, UserPassword
 
Fields inherited from class biz.hammurapi.sql.DatabaseObject
columns, objectVersion, originalVersion
 
Constructor Summary
User()
           
User(boolean force)
           
User(org.w3c.dom.Element holder, boolean force)
           
User(org.w3c.dom.Element holder, java.util.Properties pathMap, org.apache.xpath.CachedXPathAPI cxpa, boolean force)
           
User(java.sql.ResultSet rs)
           
 
Method Summary
 java.lang.Boolean hasAccess(int menuId)
          Checks access to a menu item
 boolean hasFilePermission(int fileId, java.lang.String action)
          Checks file permission.
 java.lang.Boolean hasPermission(java.lang.String className, java.lang.String actionName)
           
 boolean isInRole(java.lang.String role)
           
 void setSQLProcessor(biz.hammurapi.sql.SQLProcessor processor)
          Loads groups, roles and permissions assigned to this user.
 void toDom(org.w3c.dom.Element holder)
           
 
Methods inherited from class biz.hammurapi.web.security.sql.ApplicationUserImpl
clone, getEMail, getFirstName, getIsBlocked, getLastName, getLastPasswordChange, getLoginName, getMenuId, getNotes, getPhone, getUnmatchedBehavior, getUserPassword, project, project, setEMail, setFirstName, setIsBlocked, setLastName, setLastPasswordChange, setLoginName, setMenuId, setNotes, setPhone, setUnmatchedBehavior, setUserPassword
 
Methods inherited from class biz.hammurapi.sql.DatabaseObject
addColumn, addObserver, addRelationship, clear, configure, configure, copy, delete, equals, fromDom, fromDom, get, getAttribute, getColumn, getColumnAttribute, getObjectVersion, getRelationship, getSqlType, hashCode, 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
 

Field Detail

ADMIN_NAME

public static final java.lang.String ADMIN_NAME
See Also:
Constant Field Values
Constructor Detail

User

public User()

User

public User(boolean force)
Parameters:
force -

User

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

User

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

User

public User(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

setSQLProcessor

public void setSQLProcessor(biz.hammurapi.sql.SQLProcessor processor)
                     throws java.sql.SQLException
Loads groups, roles and permissions assigned to this user.

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

isInRole

public boolean isInRole(java.lang.String role)

toDom

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

hasPermission

public java.lang.Boolean hasPermission(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.

hasFilePermission

public boolean hasFilePermission(int fileId,
                                 java.lang.String action)
Checks file permission.

Parameters:
fileId - File ID, ignored for "Create" action
action - Action name.
Returns:

hasAccess

public java.lang.Boolean hasAccess(int menuId)
Checks access to a menu item

Parameters:
menuId -
Returns:
Boolean.TRUE if access is granted, Boolean.FALSE if denied, null if access shall be inherited.


Copyright © 2006 Hammurapi Group. All Rights Reserved.