|
Expresso 5-6 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
Interface to described a database object that is subject to security constraints. Expresso treats instances of Securable as something that can be checked on a state by state basis. Expresso uses a global setup value to determine whether non-Securable DBObjects can be granted user access through items such as DBMaint.
All classed derived from com.jcorporate.expresso.core.dbobj.SecuredDBObject automatically implement the Securable interface
Typical Usage:
Securable s = new com.jcorporate.expresso.services.dbobj.MimeTypes();
s.setRequestingUid(request.getUid());
try {
s.isAllowed("S");
System.out.println("User " + request.getUid() + " can search MimeTypes table");
} catch (java.lang.SecurityException ex) {
System.out.println("User " + request.getUid() +
" does not have permission to search MimeTypes table";
}
| Field Summary | |
static int |
SYSTEM_ACCOUNT
ID for system account. |
| Method Summary | |
int |
getRequestingUid()
Retrieve the uid of the user who's security permissions we're using. |
void |
isAllowed(String requestedFunction)
Throws a Security Exception if the user given by the earlier setRequestingUid() function does not have permission for the given function.. |
void |
setRequestingUid(int newUid)
New version of "setUser()" to to speak. |
| Field Detail |
public static final int SYSTEM_ACCOUNT
| Method Detail |
public int getRequestingUid()
public void setRequestingUid(int newUid)
newUid - Sets the UID for this DBObject. Used for security checks.
DBException - if there's a problem switching UID.
public void isAllowed(String requestedFunction)
throws SecurityException,
DBException
requestedFunction - the Requested function String, either A,U,S,D for
Add,Update,Search,Delete
SecurityException - if the user is not allowed
DBException
|
Expresso 5-6 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||