Package gda.jython.authoriser
Class SingleFileAuthoriser
java.lang.Object
gda.jython.authoriser.SingleFileAuthoriser
- All Implemented Interfaces:
Authoriser
Authoriser implementation that reads authorisation level and staff status from
the same xml file. File should be of the form
<permissions>
<user fedid="fed12345" level="3" staff="true" />
<user fedid="abc54321" level="2" />
</permissions>
- Any non "user" elements are ignored
- Any entries without a fedid attribute are ignored
- "staff" is optional and defaults to false
- "level" is optional and defaults to 1 (usually the default anyway)
-
Field Summary
Fields inherited from interface gda.jython.authoriser.Authoriser
AUTHORISERCLASS_PROPERTY, DEFAULT_AUTHORISER, DEFAULT_LEVEL, DEFAULT_LEVEL_PROPERTY, DEFAULT_STAFF_LEVEL, DEFAULT_STAFF_LEVEL_PROPERTY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintgetAuthorisationLevel(String username) booleanisLocalStaff(String username) Returns true if the username is a member of facility staff and should have elevated privileges over users.Optional<gda.jython.authoriser.SingleFileAuthoriser.User> userFromNode(org.apache.commons.configuration.tree.ConfigurationNode node) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface gda.jython.authoriser.Authoriser
getDefaultPermissions
-
Constructor Details
-
SingleFileAuthoriser
public SingleFileAuthoriser() throws org.apache.commons.configuration.ConfigurationException, IOException- Throws:
org.apache.commons.configuration.ConfigurationExceptionIOException
-
SingleFileAuthoriser
public SingleFileAuthoriser(String directory, String filename) throws org.apache.commons.configuration.ConfigurationException, IOException - Throws:
org.apache.commons.configuration.ConfigurationExceptionIOException
-
-
Method Details
-
getAuthorisationLevel
- Specified by:
getAuthorisationLevelin interfaceAuthoriser- Parameters:
username-- Returns:
- the authorisation level for the given username for this GDA installation
-
isLocalStaff
Description copied from interface:AuthoriserReturns 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:
isLocalStaffin interfaceAuthoriser- Parameters:
username-- Returns:
- the username is in a separate list for beamline staff
-
userFromNode
public Optional<gda.jython.authoriser.SingleFileAuthoriser.User> userFromNode(org.apache.commons.configuration.tree.ConfigurationNode node)
-