Interface UserAuth

All Superinterfaces:
Serializable

public interface UserAuth extends Serializable
An interface to define an application based authorisation method.

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 Classes
    Modifier and Type
    Interface
    Description
    static class 
    Class to be implemented by caller and passed during init.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Useful value.
    static final int
    A user who can approve content
    static final int
    A user who can administer any content
    static final int
    Define the various access levels.
    static final int
    A user who can add public events
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Add the user entry
    Return a collection of all authorised users
    getUser(String userid)
    Return the given authorised user.
    boolean
    Show whether user entries can be displayed or modified with this class.
    void
    Initialise the implementing object.
    void
    Update the user entry
  • Field Details

    • noPrivileges

      static final int noPrivileges
      Define the various access levels. Note these are powers of two so we can add them up.
      See Also:
    • publicEventUser

      static final int publicEventUser
      A user who can add public events
      See Also:
    • contentAdminUser

      static final int contentAdminUser
      A user who can administer any content
      See Also:
    • approverUser

      static final int approverUser
      A user who can approve content
      See Also:
    • allAuth

      static final int allAuth
      Useful value.
      See Also:
  • Method Details

    • initialise

      void initialise(UserAuth.CallBack cb) throws CalFacadeException
      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

      void addUser(BwAuthUser val) throws CalFacadeException
      Add the user entry
      Parameters:
      val - users entry
      Throws:
      CalFacadeException
    • updateUser

      void updateUser(BwAuthUser val) throws CalFacadeException
      Update the user entry
      Parameters:
      val - users entry
      Throws:
      CalFacadeException
    • getUser

      BwAuthUser getUser(String userid) throws CalFacadeException
      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