Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.jeteam.bean.security
Class PrivilegeBean  view PrivilegeBean download PrivilegeBean.java

java.lang.Object
  extended byorg.jeteam.bean.security.PrivilegeBean
All Implemented Interfaces:
javax.ejb.EnterpriseBean, javax.ejb.EntityBean, java.io.Serializable
Direct Known Subclasses:
PrivilegeBeanImpl

public abstract class PrivilegeBean
extends java.lang.Object
implements javax.ejb.EntityBean

A privilege represents an authorization for a certain action in the system. It is represented by the permission attribute that indicates what specific action is authorized.

There are two types of privileges:

1. First there are fine-grained privileges, these operate on the level of a specific method call, for example the permission User.createUser represents the authorization to create a new user in the system.

2. Secondly there are coarse-grained privileges, these are the ones that give authorization for a whole entity, for example the permission User represents the authorization to have full control over all user services as defined in the UserService EJB.

The description is an optional piece of text that gives a little more information about this privilige, however, most of the time this will be left empty.

Privileges are typically assigned to roles, but it is not mandatory to do so. However, when a privilege is not assigned to a role it has no purpose in the system; the reason to allow a privilege not to have any roles associated to it is pure for ease of use in case you would like to prepare some priviliges do not want to use them yet, this can be considered a business requirement.


Constructor Summary
PrivilegeBean()
           
 
Method Summary
 java.lang.String ejbCreate(org.jeteam.bean.security.PrivilegeData data)
           
 java.lang.String ejbCreate(java.lang.String permission, java.lang.String description)
           
 void ejbPostCreate(org.jeteam.bean.security.PrivilegeData data)
           
 void ejbPostCreate(java.lang.String permission, java.lang.String description)
           
 void ejbRemove()
           
abstract  java.lang.String getDescription()
           
abstract  java.lang.String getId()
           
abstract  java.lang.String getPermission()
           
 org.jeteam.bean.security.PrivilegeData getPrivilegeData()
           
abstract  java.util.Collection getRoles()
           
abstract  void setDescription(java.lang.String newValue)
           
abstract  void setId(java.lang.String newValue)
           
abstract  void setPermission(java.lang.String newValue)
           
 void setPrivilegeData(org.jeteam.bean.security.PrivilegeData value)
           
abstract  void setRoles(java.util.Collection roles)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.ejb.EntityBean
ejbActivate, ejbLoad, ejbPassivate, ejbStore, setEntityContext, unsetEntityContext
 

Constructor Detail

PrivilegeBean

public PrivilegeBean()
Method Detail

getId

public abstract java.lang.String getId()

setId

public abstract void setId(java.lang.String newValue)

getPermission

public abstract java.lang.String getPermission()

setPermission

public abstract void setPermission(java.lang.String newValue)

getDescription

public abstract java.lang.String getDescription()

setDescription

public abstract void setDescription(java.lang.String newValue)

getRoles

public abstract java.util.Collection getRoles()

setRoles

public abstract void setRoles(java.util.Collection roles)

getPrivilegeData

public org.jeteam.bean.security.PrivilegeData getPrivilegeData()

setPrivilegeData

public void setPrivilegeData(org.jeteam.bean.security.PrivilegeData value)

ejbCreate

public java.lang.String ejbCreate(java.lang.String permission,
                                  java.lang.String description)
                           throws javax.ejb.CreateException

ejbPostCreate

public void ejbPostCreate(java.lang.String permission,
                          java.lang.String description)
                   throws javax.ejb.CreateException

ejbCreate

public java.lang.String ejbCreate(org.jeteam.bean.security.PrivilegeData data)
                           throws javax.ejb.CreateException

ejbPostCreate

public void ejbPostCreate(org.jeteam.bean.security.PrivilegeData data)
                   throws javax.ejb.CreateException

ejbRemove

public void ejbRemove()
               throws javax.ejb.RemoveException
Specified by:
ejbRemove in interface javax.ejb.EntityBean