Class FileAuthoriser

java.lang.Object
gda.jython.authoriser.FileAuthoriser
All Implemented Interfaces:
Authoriser
Direct Known Subclasses:
LdapAuthoriser

public class FileAuthoriser extends Object implements Authoriser
Performs authentication via a file listing usernames and access levels.
  • Constructor Details

    • FileAuthoriser

      public FileAuthoriser()
  • Method Details

    • getEntries

      public UserEntry[] getEntries()
      Returns:
      Vector of strings of the entries in this file
    • addEntry

      public void addEntry(String username, int newLevel, boolean isStaff)
      Adds an entry to the file
      Parameters:
      username -
      newLevel -
      isStaff -
    • deleteEntry

      public void deleteEntry(String username)
      Removes an entry from the file
      Parameters:
      username -
    • getAuthorisationLevel

      public int getAuthorisationLevel(String username)
      Specified by:
      getAuthorisationLevel in interface Authoriser
      Parameters:
      username -
      Returns:
      the authorisation level for the given username for this GDA installation
    • isLocalStaff

      public boolean isLocalStaff(String username)
      Description copied from interface: Authoriser
      Returns true if the username is a member of facility staff and should have elevated privileges over users. Any accounts used for beamline testing/commissioning should also return true when using this method.
      Specified by:
      isLocalStaff in interface Authoriser
      Parameters:
      username -
      Returns:
      the username is in a separate list for beamline staff
    • hasAuthorisationLevel

      public boolean hasAuthorisationLevel(String username)