Interface UserAuth
- All Superinterfaces:
Serializable
The actual authorisation of the user will be site specific. For example, if we are using a roles based scheme, the implementation of this interface will check the current users role.
There is no method to add a user as we are simply giving users certain rights. The underlying implementation may choose to use a database and remove those entries for which there are no special rights.
- Version:
- 2.2
- Author:
- Mike Douglass douglm@rpi.edu
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classClass to be implemented by caller and passed during init. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intUseful value.static final intA user who can approve contentstatic final intA user who can administer any contentstatic final intDefine the various access levels.static final intA user who can add public events -
Method Summary
Modifier and TypeMethodDescriptionvoidaddUser(BwAuthUser val) Add the user entrygetAll()Return a collection of all authorised usersReturn the given authorised user.booleanShow whether user entries can be displayed or modified with this class.voidInitialise the implementing object.voidupdateUser(BwAuthUser val) Update the user entry
-
Field Details
-
noPrivileges
static final int noPrivilegesDefine the various access levels. Note these are powers of two so we can add them up.- See Also:
-
publicEventUser
static final int publicEventUserA user who can add public events- See Also:
-
contentAdminUser
static final int contentAdminUserA user who can administer any content- See Also:
-
approverUser
static final int approverUserA user who can approve content- See Also:
-
allAuth
static final int allAuthUseful value.- See Also:
-
-
Method Details
-
initialise
Initialise the implementing object. This method may be called repeatedly with the same or different classes of object.This is not all that well-defined. This area falls somewhere between the back-end and the front-end, depending upon how a site implements its authorisation.
Any implementation is free to ignore the call altogether.
- Parameters:
cb- CallBack object- Throws:
CalFacadeException- If there's a problem
-
getUserMaintOK
boolean getUserMaintOK()Show whether user entries can be displayed or modified with this class. Some sites may use other mechanisms.This may need supplementing with changes to the jsp. For example, it's hard to deal programmatically with the case of directory/roles based authorisation and db based user information.
- Returns:
- boolean true if user maintenance is implemented.
-
addUser
Add the user entry- Parameters:
val- users entry- Throws:
CalFacadeException
-
updateUser
Update the user entry- Parameters:
val- users entry- Throws:
CalFacadeException
-
getUser
Return the given authorised user. Will always return an entry (except for exceptional conditions.) An unauthorised user will have a usertype of noPrivileges.- Parameters:
userid- String user id- Returns:
- BwAuthUser users entry
- Throws:
CalFacadeException
-
getAll
Return a collection of all authorised users- Returns:
- Collection of BwAuthUser for users with any special authorisation.
- Throws:
CalFacadeException
-