uk.ac.soton.itinnovation.grid.pbac2.pdp.webadmin
Class ACLadmin

java.lang.Object
  extended by uk.ac.soton.itinnovation.grid.pbac2.pdp.webadmin.ACLadmin

public class ACLadmin
extends Object

Provides code to create a web administration interface for PBAC access control lists. To use it, create a new ACLadmin object in your JSP page and then call addACLmodelToContext(). You should then render the ACLmodel object, which can be found in the "acl" attribute of the request context.


Field Summary
static int TYPE_ANYONE
           
static int TYPE_CA
           
static int TYPE_MEMBER
           
static int TYPE_NONE
           
static int TYPE_SAML
           
static int TYPE_SUBJECT_DN
           
static int TYPE_TRUSTED_START
           
 
Constructor Summary
ACLadmin(PDP pdp, HttpServletRequest request)
          Convenience constructor with other arguments set to null.
ACLadmin(PDP pdp, HttpServletRequest request, HttpServletResponse response)
           
ACLadmin(PDP pdp, HttpServletRequest request, String resourceID)
          Convenience constructor with other arguments set to null.
ACLadmin(PDP pdp, HttpServletRequest request, String resourceID, HttpServletResponse response)
           
ACLadmin(PDP pdp, HttpServletRequest request, String resourceID, String fragment, HttpServletResponse response)
          Create a new ACLadmin from the parameters in this request.
 
Method Summary
 void addACLmodelToContext()
          Generate the ACLmodel for this resource, ready for rendering.
 void addTrustedAttributeType(String name, String menuText, String formText)
          Add a trusted attribute that the user can add to this ACL.
 ACLmodel getACLmodel()
           
static Map<String,String> getDeleteParameters(PolicyRule rule)
          Get the details needed to identify a match rule to be deleted.
 String getResourceType()
           
static String selected(PolicyRuleType value, PolicyRuleType defaultValue)
           
static String selected(String value, String defaultValue)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE_NONE

public static final int TYPE_NONE
See Also:
Constant Field Values

TYPE_SUBJECT_DN

public static final int TYPE_SUBJECT_DN
See Also:
Constant Field Values

TYPE_CA

public static final int TYPE_CA
See Also:
Constant Field Values

TYPE_SAML

public static final int TYPE_SAML
See Also:
Constant Field Values

TYPE_MEMBER

public static final int TYPE_MEMBER
See Also:
Constant Field Values

TYPE_ANYONE

public static final int TYPE_ANYONE
See Also:
Constant Field Values

TYPE_TRUSTED_START

public static final int TYPE_TRUSTED_START
See Also:
Constant Field Values
Constructor Detail

ACLadmin

public ACLadmin(PDP pdp,
                HttpServletRequest request)
         throws InvalidResourceIDException
Convenience constructor with other arguments set to null.

Throws:
InvalidResourceIDException

ACLadmin

public ACLadmin(PDP pdp,
                HttpServletRequest request,
                String resourceID)
         throws InvalidResourceIDException
Convenience constructor with other arguments set to null.

Throws:
InvalidResourceIDException

ACLadmin

public ACLadmin(PDP pdp,
                HttpServletRequest request,
                String resourceID,
                HttpServletResponse response)
         throws InvalidResourceIDException
Throws:
InvalidResourceIDException

ACLadmin

public ACLadmin(PDP pdp,
                HttpServletRequest request,
                HttpServletResponse response)
         throws InvalidResourceIDException
Throws:
InvalidResourceIDException

ACLadmin

public ACLadmin(PDP pdp,
                HttpServletRequest request,
                String resourceID,
                String fragment,
                HttpServletResponse response)
         throws InvalidResourceIDException
Create a new ACLadmin from the parameters in this request.

Parameters:
request - servlet's request object
resourceID - resource to use. If null, uses request.getParameter("resource")
fragment - fragment identifier to add to links (e.g. "acl" to link to "page.jsp#acl")
Throws:
InvalidResourceIDException
Method Detail

addACLmodelToContext

public void addACLmodelToContext()
                          throws IOException,
                                 org.apache.commons.fileupload.FileUploadException,
                                 CertificateException
Generate the ACLmodel for this resource, ready for rendering. The model bean is stored in an "acl" attribute on the request.

Throws:
IOException
org.apache.commons.fileupload.FileUploadException
CertificateException

getACLmodel

public ACLmodel getACLmodel()
                     throws IOException,
                            org.apache.commons.fileupload.FileUploadException,
                            CertificateException
Throws:
IOException
org.apache.commons.fileupload.FileUploadException
CertificateException

getDeleteParameters

public static Map<String,String> getDeleteParameters(PolicyRule rule)
Get the details needed to identify a match rule to be deleted. The values in the returned map can be used later to delete this rule. They will typically be added to an HTML form as hidden values.

Parameters:
rule - the rule to be deleted
Returns:
a map containing the names and values of the required attributes

selected

public static String selected(String value,
                              String defaultValue)

selected

public static String selected(PolicyRuleType value,
                              PolicyRuleType defaultValue)

getResourceType

public String getResourceType()

addTrustedAttributeType

public void addTrustedAttributeType(String name,
                                    String menuText,
                                    String formText)
Add a trusted attribute that the user can add to this ACL.

Parameters:
name - the attribute name
menuText - the label for the menu (e.g. "User name is ...")
formText - the label for the value box (e.g. "User name:")
See Also:
TrustedAttribute


Copyright © 2001-2008 University of Southampton IT Innovation Centre. All Rights Reserved.