|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface AuthFilter
An AuthFilter is a plain java class implementing data visibility logic
for use by UI nodes and Authorizer nodes. It provides a
standard approach to filtering data access at the message, field, and
value levels. Functionally it works like a firewall for messages, with
the UI checking to see what is reasonable to try send through. With
both types of processing working off the same code, the system is
secure from rogue clients, and the UI doesn't let the user get into
trouble trying to do something they are not allowed to do.
An AuthFilter implementation defines an authorization matrix:
| Access Level | Allowed Access |
| Message class | No access |
| Message instance | Field value hidden |
| Message field | Read only |
| Message field value | Read/Write Unrestricted |
These levels of access also work for a field that contains an array of references or contained (dependent) message instances. However for fine grained access control over what may or may not be done with array elements, the AUTH_ARRAY* values can alternatively be used to create a bitmask of allowed operations.
Secure communications using an AuthFilter require that the caller
messageClassAccess to determine if a given
message class may be seen at all by this user.
messageClassAccess is allowed, then
call messageInstanceAccess to see if the particular
message may be seen at all by this user.
messageInstanceAccess is allowed,
then call messageFieldAccess for each field in
the message to see if that field may be seen or modified by
this user.
messageFieldAccess is allowed, then
call messageFieldValueAccess to see if this value
may be seen or specified by this user.
UI forms using an AuthFilter requires that the caller
messageInstanceAccess with a
SandUpdateMessage describing the instance to be
updated and the action to be taken. The returned authorization
determines if the action is supported or not.
tokenAccess for any custom buttons or navigation
links to determine if they should be displayed. Note that hiding
a screen does not preclude actions from being taken by a rogue
client. The purpose of tokenAccess is to turn off
custom actions or screens which would not work due to the
authorization context, so that the user does not have to discover
this by trying and failing. It should be considered a convenience
UI control method rather than a true security measure.
Implementation notes:
SandException.
| Field Summary | |
|---|---|
static int |
AUTH_ARRAYACCESS
An indicator that the returned value is a compound value describing the types of operations permitted on an array of elements. |
static int |
AUTH_ARRAYADD
Indicates that array add operations are supported. |
static int |
AUTH_ARRAYDELETE
Indicates that array delete operations are supported. |
static int |
AUTH_ARRAYMOVE
Indicates that array move operations are supported. |
static int |
AUTH_ARRAYNEW
Indicates that a new element instance may be added to a reference array. |
static int |
AUTH_NOACCESS
The user is not allowed access to this field or message at all. |
static int |
AUTH_READONLY
The user is allowed to query and view the message or field and its data, but they may not make changes to it. |
static int |
AUTH_READONLYNODISP
Equivalent to AUTH_READONLY, except that the field is not displayed to the user in the standard user interface. |
static int |
AUTH_UNRESTRICTED
The user is allowed to query, read, modify the message or field and its data. |
static int |
AUTH_UNRESTRICTEDNODISP
Equivalent to AUTH_UNRESTRICTED, except that the field is not displayed to the user in the standard user interface. |
static int |
AUTH_UNRESTRICTEDREADONLY
Equivalent to AUTH_UNRESTRICTED, except that the field is displayed as read only in the standard user interface. |
static int |
AUTH_VALHIDDEN
The user is allowed access to the field, so they can see that the field exists, but they are not allowed access to the field value in this instance. |
| Method Summary | |
|---|---|
SandAttrVal[] |
matchRestrictions(AuthUser user,
java.lang.String className,
SandAttrVal[] savs)
Return additional match constraints for a query or entry display. |
int |
messageClassAccess(AuthUser user,
java.lang.String className)
Return one of the AUTH* constants describing allowed access to the specified class. |
int |
messageFieldAccess(AuthUser user,
SandMessage msg,
java.lang.String fieldName)
Return one of the AUTH* constants describing the allowed access to the specified field in the specified class. |
int |
messageFieldValueAccess(AuthUser user,
SandMessage msg,
java.lang.String fieldName)
Return one of the AUTH* constants describing the allowed access to the specified field in the given message instance. |
int |
messageInstanceAccess(AuthUser user,
SandMessage msg)
Return one of the AUTH* constants describing allowed access to the specified class instance. |
int |
tokenAccess(AuthUser user,
java.lang.String token)
Return one of the AUTH* constants describing the allowed access to the specified token. |
| Field Detail |
|---|
static final int AUTH_NOACCESS
static final int AUTH_VALHIDDEN
This value is typically only used when displaying information returned from a query. Showing a field without showing the value doesn't exactly make users feel empowered, but can be necessary in some instances.
The other use of this authorization value is when restricting access to a screen or other UI element in tokenAccess. In that case AUTH_VALHIDDEN means that the element is not displayed, but can still be called directly via URL parameters.
static final int AUTH_READONLYNODISP
static final int AUTH_READONLY
static final int AUTH_UNRESTRICTEDNODISP
static final int AUTH_UNRESTRICTEDREADONLY
static final int AUTH_UNRESTRICTED
static final int AUTH_ARRAYACCESS
For example if you had an array of contained messages, and you wanted to disallow the deletion, then you would return AUTH_ARRAYACCESS|AUTH_ARRAYADD|AUTH_ARRAYMOVE
static final int AUTH_ARRAYDELETE
static final int AUTH_ARRAYADD
static final int AUTH_ARRAYMOVE
static final int AUTH_ARRAYNEW
| Method Detail |
|---|
int messageClassAccess(AuthUser user,
java.lang.String className)
throws SandException
Usage:
SandException
int messageInstanceAccess(AuthUser user,
SandMessage msg)
throws SandException
Usage:
This method is called only if messageClassAccess is allowed.
SandException
int messageFieldAccess(AuthUser user,
SandMessage msg,
java.lang.String fieldName)
throws SandException
Usage:
This method is called only if messageInstanceAccess is allowed.
SandException
int messageFieldValueAccess(AuthUser user,
SandMessage msg,
java.lang.String fieldName)
throws SandException
Usage:
This method is called only if messageFieldAccess is allowed.
SandException
SandAttrVal[] matchRestrictions(AuthUser user,
java.lang.String className,
SandAttrVal[] savs)
throws SandException
The match constraints are added by the Authorizer when
processing a query, to prevent unauthorized information from
being retrieved. The same constraints can also be used by the
UI to filter and check for invalid options.
When filtering possible field values in the UI, care must be
taken to monitor the number of available values remaining. If
only one value is possible, then the field should be switched
to READONLY with that value. If no values are possible the field
should be switched to NOACCESS. Similar logic applies to range
reductions on integer values.
The current query values are provided as a reference for existing restrictions to avoid duplication or add successive refinements.
Usage:
SandException
int tokenAccess(AuthUser user,
java.lang.String token)
throws SandException
Usage:
SandException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||