org.openanzo.common.utils
Class ACLUtil

java.lang.Object
  extended by org.openanzo.common.utils.ACLUtil

public class ACLUtil
extends java.lang.Object

Convenience methods for accessing ACL data within ANZO metadata graphs

Author:
Matthew Roy ( mroy@cambridgesemantics.com )

Constructor Summary
ACLUtil()
           
 
Method Summary
static org.openrdf.model.URI getACL(INamedGraphWithMetaData graph)
          Returns the ACL for the given named graph.
static void setAddPermission(INamedGraphWithMetaData graph, org.openrdf.model.URI role, boolean permission)
          Sets the add permission on the given graph for the given role.
static void setChangeNamedGraphACLPermission(INamedGraphWithMetaData graph, org.openrdf.model.URI role, boolean permission)
          Sets the change ACL permission on this graph for the given role.
static void setCreateNamedGraphsPermission(INamedGraphWithMetaData graph, org.openrdf.model.URI role, boolean permission)
          Sets the permission to create new graphs for the given role
static void setPermissions(INamedGraphWithMetaData graph, org.openrdf.model.URI role, boolean read, boolean add, boolean remove, boolean createNamedGraphs, boolean removeNamedGraphs, boolean changeNamedGraphACL)
          Sets the permissions for the given role on the given named graph.
static void setReadPermission(INamedGraphWithMetaData graph, org.openrdf.model.URI role, boolean permission)
          Sets the read permission on the given graph for the given role.
static void setRemoveNamedGraphsPermission(INamedGraphWithMetaData graph, org.openrdf.model.URI role, boolean permission)
          Sets the permission to remove the named graphs for the given role
static void setRemovePermission(INamedGraphWithMetaData graph, org.openrdf.model.URI role, boolean permission)
          Sets the remove permission on the given graph for the given role.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ACLUtil

public ACLUtil()
Method Detail

setReadPermission

public static void setReadPermission(INamedGraphWithMetaData graph,
                                     org.openrdf.model.URI role,
                                     boolean permission)
Sets the read permission on the given graph for the given role.

Parameters:
graph - for which the ACL will be changed
role - target role for which the permission is to be set
permission - true to allow the given role permission to read statements from this graph, false otherwise

setAddPermission

public static void setAddPermission(INamedGraphWithMetaData graph,
                                    org.openrdf.model.URI role,
                                    boolean permission)
Sets the add permission on the given graph for the given role.

Parameters:
graph - for which the ACL will be changed
role - target role for which the permission is to be set
permission - true to allow the given role permission to add statements to this graph, false otherwise

setRemovePermission

public static void setRemovePermission(INamedGraphWithMetaData graph,
                                       org.openrdf.model.URI role,
                                       boolean permission)
Sets the remove permission on the given graph for the given role.

Parameters:
graph - for which the ACL will be changed
role - target role for which the permission is to be set
permission - true to allow the given role permission to remove statements from this graph, false otherwise

setCreateNamedGraphsPermission

public static void setCreateNamedGraphsPermission(INamedGraphWithMetaData graph,
                                                  org.openrdf.model.URI role,
                                                  boolean permission)
Sets the permission to create new graphs for the given role

Parameters:
graph - for which the ACL will be changed
role - target role for which the permission is to be set
permission - true to allow the given role permission to create a new graph, false otherwise

setRemoveNamedGraphsPermission

public static void setRemoveNamedGraphsPermission(INamedGraphWithMetaData graph,
                                                  org.openrdf.model.URI role,
                                                  boolean permission)
Sets the permission to remove the named graphs for the given role

Parameters:
graph - for which the ACL will be changed
role - target role for which the permission is to be set
permission - true to allow the given role permission to remove the named graph, false otherwise

setChangeNamedGraphACLPermission

public static void setChangeNamedGraphACLPermission(INamedGraphWithMetaData graph,
                                                    org.openrdf.model.URI role,
                                                    boolean permission)
Sets the change ACL permission on this graph for the given role.

Parameters:
graph - for which the ACL will be changed
role - target role for which the permission is to be set
permission - true to allow the given role permission to change this ACL, false otherwise

setPermissions

public static void setPermissions(INamedGraphWithMetaData graph,
                                  org.openrdf.model.URI role,
                                  boolean read,
                                  boolean add,
                                  boolean remove,
                                  boolean createNamedGraphs,
                                  boolean removeNamedGraphs,
                                  boolean changeNamedGraphACL)
Sets the permissions for the given role on the given named graph.

Parameters:
graph - for which the ACL will be changed
role - the target role for which permissions are being set for this graph
read - true if role has permission to read, false otherwise
add - true if role has permission to add statements, false otherwise
remove - true if role has permission to remove statements, false otherwise
createNamedGraphs - true if role has permission to create new NamedGraphs, false otherwise
removeNamedGraphs - true if role has permission to remove NamedGraphs, false otherwise
changeNamedGraphACL - true if role has permission to change the ACL of the NamedGraph, false otherwise

getACL

public static org.openrdf.model.URI getACL(INamedGraphWithMetaData graph)
Returns the ACL for the given named graph.

Parameters:
graph - the graph for which the ACL will be returned
Returns:
the ACL for the given named graph


Copyright © 2007 Cambridge Semantics Inc.. All Rights Reserved.