Adding RequiresActions interface
This commit is contained in:
parent
3bb968a72a
commit
63da01ed7b
1 changed files with 34 additions and 0 deletions
|
@ -0,0 +1,34 @@
|
||||||
|
package edu.cornell.mannlib.vitro.webapp.auth.requestedAction.ifaces;
|
||||||
|
|
||||||
|
import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.Actions;
|
||||||
|
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Interface to objects that provide a list of Actions that are
|
||||||
|
* required for the object to be used.
|
||||||
|
*
|
||||||
|
* This is intended to provide a way to setup DataGetter
|
||||||
|
* objects to be used with the FreemarkerHttpServlet.requiredActions()
|
||||||
|
* method.
|
||||||
|
*
|
||||||
|
* @author bdc34
|
||||||
|
*/
|
||||||
|
public interface RequiresActions {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns Actions that are required to be authorized for
|
||||||
|
* the object to be used.
|
||||||
|
*
|
||||||
|
* The code that is calling this method
|
||||||
|
* could use methods from PolicyHelper to check if the
|
||||||
|
* request has authorization to do these Actions. The code
|
||||||
|
* calling this method would then have the ability to
|
||||||
|
* deny the action if it is not authorized.
|
||||||
|
*
|
||||||
|
* @param vreq
|
||||||
|
* @return Should not be null. Return Actions.AUTHORIZED
|
||||||
|
* if no authorization is required to do use the object.
|
||||||
|
*/
|
||||||
|
public Actions requiredActions(VitroRequest vreq) ;
|
||||||
|
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue