|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD | |||||||||
java.lang.Objectjava.lang.Enum<Access>
org.eaglei.repository.Access
public enum Access
Access control for the repository. The Access class is two things: 1. Enumerated type describing the type of operation the user is allowed to do. These correspond to REPO constants (and maybe should move there?) 2. A collection of static utility methods to answer access control questions Started April, 2010
| Enum Constant Summary | |
|---|---|
ADD
|
|
ADMIN
|
|
READ
Types of access to be granted |
|
REMOVE
|
|
| Field Summary | |
|---|---|
static java.lang.String |
SUPERUSER_ROLE_NAME
Superuser role name, i.e. |
| Method Summary | |
|---|---|
static void |
addGrant(javax.servlet.http.HttpServletRequest request,
org.openrdf.model.URI instance,
org.openrdf.model.URI agent,
org.openrdf.model.URI access)
Add the specified grant to the instance. |
static void |
decacheUser(javax.servlet.http.HttpServletRequest request,
User u)
invalidate the cache if the changed user is the same URI as cahced. |
static void |
filterByPermission(javax.servlet.http.HttpServletRequest request,
org.openrdf.model.URI aprincipal,
java.lang.String name,
java.lang.String patternGroup,
Access pred,
org.openrdf.query.TupleQueryResultHandler handler)
Filters results of query by what the current user has indicated permission on.. |
static java.lang.Iterable<AccessGrant.Term> |
getAllAccesses(javax.servlet.http.HttpServletRequest request)
Get all access types described in the RDF - note this CAN be extended by each repository instance by adding statements but it is NOT likely since the practical implementation of access is hardcoded. |
static java.lang.Iterable<AccessGrant.Term> |
getAllRoles(javax.servlet.http.HttpServletRequest request)
Get all roles described in the RDF - note this can be extended by each repository instance by adding statements. |
static java.lang.Iterable<AccessGrant> |
getGrants(javax.servlet.http.HttpServletRequest request,
org.openrdf.model.URI uri,
boolean mine)
Get list of access grants on this instance |
static org.openrdf.model.URI |
getPrincipalURI(javax.servlet.http.HttpServletRequest request)
Find (and create if necessary) the URI of the :Person object for the current authenticated user, if any. |
static User |
getPrincipalUser(javax.servlet.http.HttpServletRequest request)
Find (and create if necessary) a User object for the current authenticated user, if any. |
org.openrdf.model.URI |
getURI()
Get the URI referenced by this access type. |
static boolean |
hasPermission(javax.servlet.http.HttpServletRequest request,
org.openrdf.model.Resource subject,
Access pred)
hasPermission - general permission test. |
static boolean |
hasPermissionOnUser(javax.servlet.http.HttpServletRequest request,
java.lang.String username)
Does current authenticated user have permission to modify the User object associated with this username? True if it matches the current logged-in user, or we are superuser. |
static boolean |
isSuperuser(javax.servlet.http.HttpServletRequest request)
isSuperuser |
static void |
logout(javax.servlet.http.HttpServletRequest request)
Destroy current session and credentials (if possible) most web browsers cache the HTTP Basic creds so user needs to trash those explicitly right after running this. |
static boolean |
removeGrant(javax.servlet.http.HttpServletRequest request,
org.openrdf.model.URI instance,
org.openrdf.model.URI agent,
org.openrdf.model.URI access)
Remove specified grant of access from an instance. |
static Access |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. |
static Access[] |
values()
Returns an array containing the constants of this enum type, in the order they are declared. |
| Methods inherited from class java.lang.Enum |
|---|
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Enum Constant Detail |
|---|
public static final Access READ
public static final Access ADD
public static final Access REMOVE
public static final Access ADMIN
| Field Detail |
|---|
public static final java.lang.String SUPERUSER_ROLE_NAME
| Method Detail |
|---|
public static Access[] values()
for (Access c : Access.values()) System.out.println(c);
public static Access valueOf(java.lang.String name)
name - the name of the enum constant to be returned.
java.lang.IllegalArgumentException - if this enum type has no constant
with the specified name
java.lang.NullPointerException - if the argument is nullpublic org.openrdf.model.URI getURI()
URI object.
public static boolean hasPermission(javax.servlet.http.HttpServletRequest request,
org.openrdf.model.Resource subject,
Access pred)
hasPermission - general permission test.
request - a HttpServletRequest object.subject - the object being tested for accesspred - the type of access
public static boolean hasPermissionOnUser(javax.servlet.http.HttpServletRequest request,
java.lang.String username)
request - a HttpServletRequest object.username - principal (i.e. RDBMS username, value of :hasPrincipal), a String object.
public static void filterByPermission(javax.servlet.http.HttpServletRequest request,
org.openrdf.model.URI aprincipal,
java.lang.String name,
java.lang.String patternGroup,
Access pred,
org.openrdf.query.TupleQueryResultHandler handler)
request - a HttpServletRequest object.principal - URI of user or role being checked for permissionname - name of the variable in query, a String object.patternGroup - query fragmentpred - type of access being tested, a Access object.handler - a TupleQueryResultHandler object.public static org.openrdf.model.URI getPrincipalURI(javax.servlet.http.HttpServletRequest request)
request - a HttpServletRequest object.
URI object.
public static void decacheUser(javax.servlet.http.HttpServletRequest request,
User u)
request - a HttpServletRequest object.u - user to decache, a User object.public static User getPrincipalUser(javax.servlet.http.HttpServletRequest request)
request - a HttpServletRequest object.
public static boolean isSuperuser(javax.servlet.http.HttpServletRequest request)
isSuperuser
Predicate, true if current auth'd user has superuser role either in RDF assertion or in the container's authz.
request - a HttpServletRequest object.
public static void logout(javax.servlet.http.HttpServletRequest request)
request - a HttpServletRequest object.
public static boolean removeGrant(javax.servlet.http.HttpServletRequest request,
org.openrdf.model.URI instance,
org.openrdf.model.URI agent,
org.openrdf.model.URI access)
request - a HttpServletRequest object.instance - subject from which to remove access grant a URI object.agent - principal to whom the access was granted, a URI object.access - type of access, a URI object.
public static void addGrant(javax.servlet.http.HttpServletRequest request,
org.openrdf.model.URI instance,
org.openrdf.model.URI agent,
org.openrdf.model.URI access)
request - a HttpServletRequest object.instance - subject from which to add access grant a URI object.agent - principal to whom the access was granted, a URI object.access - type of access, a URI object.
public static java.lang.Iterable<AccessGrant> getGrants(javax.servlet.http.HttpServletRequest request,
org.openrdf.model.URI uri,
boolean mine)
request - a HttpServletRequest object.uri - subject on which to find grants, a URI object.mine - when true, only return grants affecting current user
Iterable object, possibly empty.public static java.lang.Iterable<AccessGrant.Term> getAllRoles(javax.servlet.http.HttpServletRequest request)
request - a HttpServletRequest object.
Iterable object.public static java.lang.Iterable<AccessGrant.Term> getAllAccesses(javax.servlet.http.HttpServletRequest request)
request - a HttpServletRequest object.
Iterable object.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD | |||||||||