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

Quick Search    Search Deep

com.RuntimeCollective.permission.bean
Interface Permissible  view Permissible download Permissible.java

All Superinterfaces:
com.RuntimeCollective.webapps.bean.EntityBean, com.RuntimeCollective.webapps.bean.PermissionBean, java.io.Serializable
All Known Implementing Classes:
PermissibleExtension, SimplePermissible

public interface Permissible
extends com.RuntimeCollective.webapps.bean.PermissionBean, com.RuntimeCollective.webapps.bean.EntityBean

Interface to implement if you want the access to your object to be constrained by PermissionRules.

If you want to be spared the hassle of writing JSPs to assign PermissionRules to your Permissible objects, do have a look at the pages written for the Sussex Enterprise project. You can find them by checking out the relevent project: "cvs co rsework", then look in rsework/web/admin.

The page is called publishPage-step3.jsp, and is part of the publishing process (Publishable is a subclass of Permissible). The rsework/struts-config.xml file is also worth checking, for the action mappings etc.

And while you're at it, why not vanilla the page and copy it to permissible/web/admin ...

You can also check the Sussex Enterprise staging server (ask Fabrice, JoeH or Sophie).

Version:
$Id: Permissible.java,v 1.6 2003/09/30 15:12:49 joe Exp $

Field Summary
static java.lang.String DATABASE_TABLE
          The name of the database table for this bean type.
static java.lang.String EDIT_ACTION
          The action for object editing.
static java.lang.String VIEW_ACTION
          The action for object viewing.
 
Fields inherited from interface com.RuntimeCollective.webapps.bean.EntityBean
INTERFACE_BEAN, NULL_ID
 
Method Summary
 boolean canEdit(com.RuntimeCollective.webapps.bean.User user)
          Can a user "edit" this Bean.
 boolean canPerformAction(java.lang.String action, com.RuntimeCollective.webapps.bean.User user)
          Can a given User perform a given action on that Bean?
 boolean canView(com.RuntimeCollective.webapps.bean.User user)
          Can a user "view" this Bean.
 void delete()
          Delete this bean from the database.
 PermissionRule getActionPermissionRule(java.lang.String action)
          Get the PermissionRule for a given action on this Bean.
 java.util.Iterator getActions()
          Get an Iterator of the actions constrained until now.
 java.lang.String getAuthorisationPathForAction(java.lang.String action, javax.servlet.http.HttpSession session, java.lang.String returnPath)
          Deprecated. This method was modified not to refer to Client Tier classes (HttpSession). Use instead: getAuthorisationPathForAction(action, (User) session.getAttribute(RuntimeParameters.get("logonUserKey")), (Session) session.getAttribute(Session.SESSION_KEY), new HttpSessionReturnPathContainer(session), returnPath)
 java.lang.String getAuthorisationPathForAction(java.lang.String action, com.RuntimeCollective.webapps.bean.User user, com.RuntimeCollective.webapps.bean.Session session, com.RuntimeCollective.webapps.ReturnPathContainer rpContainer, java.lang.String returnPath)
          Get the path of the page where a User should be sent in order to (maybe) get authorised for an action.
 int getId()
          Get the unique id of this bean instance.
 void save()
          Save this bean to the database.
 void setActionPermissionRule(java.lang.String action, PermissionRule permissionRule)
          Set the PermissionRule for a given action on this Bean.
 void setId(int id)
          Set the unique id of this bean instance.
 

Field Detail

DATABASE_TABLE

public static final java.lang.String DATABASE_TABLE
The name of the database table for this bean type.

See Also:
Constant Field Values

VIEW_ACTION

public static final java.lang.String VIEW_ACTION
The action for object viewing.

See Also:
Constant Field Values

EDIT_ACTION

public static final java.lang.String EDIT_ACTION
The action for object editing.

See Also:
Constant Field Values
Method Detail

getId

public int getId()
Get the unique id of this bean instance.

Specified by:
getId in interface com.RuntimeCollective.webapps.bean.EntityBean

setId

public void setId(int id)
Set the unique id of this bean instance.

Specified by:
setId in interface com.RuntimeCollective.webapps.bean.EntityBean

save

public void save()
Save this bean to the database.

Specified by:
save in interface com.RuntimeCollective.webapps.bean.EntityBean

delete

public void delete()
Delete this bean from the database.

Specified by:
delete in interface com.RuntimeCollective.webapps.bean.EntityBean

canEdit

public boolean canEdit(com.RuntimeCollective.webapps.bean.User user)
Can a user "edit" this Bean.

Specified by:
canEdit in interface com.RuntimeCollective.webapps.bean.PermissionBean

canView

public boolean canView(com.RuntimeCollective.webapps.bean.User user)
Can a user "view" this Bean.

Specified by:
canView in interface com.RuntimeCollective.webapps.bean.PermissionBean

setActionPermissionRule

public void setActionPermissionRule(java.lang.String action,
                                    PermissionRule permissionRule)
Set the PermissionRule for a given action on this Bean.


getActionPermissionRule

public PermissionRule getActionPermissionRule(java.lang.String action)
Get the PermissionRule for a given action on this Bean.


canPerformAction

public boolean canPerformAction(java.lang.String action,
                                com.RuntimeCollective.webapps.bean.User user)
Can a given User perform a given action on that Bean?


getAuthorisationPathForAction

public java.lang.String getAuthorisationPathForAction(java.lang.String action,
                                                      javax.servlet.http.HttpSession session,
                                                      java.lang.String returnPath)
Deprecated. This method was modified not to refer to Client Tier classes (HttpSession). Use instead: getAuthorisationPathForAction(action, (User) session.getAttribute(RuntimeParameters.get("logonUserKey")), (Session) session.getAttribute(Session.SESSION_KEY), new HttpSessionReturnPathContainer(session), returnPath)

Get the path of the page where the Session should be sent in order to (maybe) get authorised for an action. Also sets required attributes in the Session.

On submission of that page, the Session should be checked again, as there may be more than one page to go to.


getAuthorisationPathForAction

public java.lang.String getAuthorisationPathForAction(java.lang.String action,
                                                      com.RuntimeCollective.webapps.bean.User user,
                                                      com.RuntimeCollective.webapps.bean.Session session,
                                                      com.RuntimeCollective.webapps.ReturnPathContainer rpContainer,
                                                      java.lang.String returnPath)
Get the path of the page where a User should be sent in order to (maybe) get authorised for an action.

On submission of that resulting page, the user should be checked again, as there may be more than one page to go to before he/she is authorised.


getActions

public java.util.Iterator getActions()
Get an Iterator of the actions constrained until now.