.. java:import:: java.util Map .. java:import:: java.util Set UserSource ========== .. java:package:: org.caosdb.server.accessControl :noindex: .. java:type:: public interface UserSource UserSources are sources for users - i.e. they authenticate users and contain basic information about users. UserSources let you check if a user exists - \ :java:ref:`isUserExisting(String)`\authenticate a user via a password - \ :java:ref:`isValid(String,String)`\get the default \ :java:ref:`UserStatus`\ - \ :java:ref:`getDefaultUserStatus(String)`\get the default email address - \ :java:ref:`getDefaultUserEmail(String)`\retrieve a users roles - \ :java:ref:`resolveRolesForUsername(String)`\ The default email and default \ :java:ref:`UserStatus`\ might be overridden by other settings in CaosDB - that's why they are called "default". Also, the user's roles might be overridden by the internal user source \ :java:ref:`InternalUserSource`\ . A UserSource is configured via \ :java:ref:`setMap(Map)`\ . :author: Timm Fitschen (t.fitschen@indiscale.com) Methods ------- getDefaultUserEmail ^^^^^^^^^^^^^^^^^^^ .. java:method:: public String getDefaultUserEmail(String username) :outertype: UserSource Return the email address of that user, or null if none is available as per this user source. This method does not check if a user exists. So it will return null for unknown users. :param username: :return: The email address or null getDefaultUserStatus ^^^^^^^^^^^^^^^^^^^^ .. java:method:: public UserStatus getDefaultUserStatus(String username) :outertype: UserSource Return the \ :java:ref:`UserStatus`\ of that user. :param username: :return: The user status of that user getName ^^^^^^^ .. java:method:: public String getName() :outertype: UserSource Every UserSource has a unique name, e.g. PAM, CaosDB (which is default name of the internal user source \ :java:ref:`InternalUserSource`\ ). :return: name isUserExisting ^^^^^^^^^^^^^^ .. java:method:: public boolean isUserExisting(String username) :outertype: UserSource Check if a user exists. :param username: :return: true iff this user source knows a user with that name isValid ^^^^^^^ .. java:method:: public boolean isValid(String username, String password) :outertype: UserSource Check if the user can be authenticated by the given password. :param username: :param password: :return: true iff the password was correct. resolveRolesForUsername ^^^^^^^^^^^^^^^^^^^^^^^ .. java:method:: public Set resolveRolesForUsername(String username) :outertype: UserSource Return all roles that a user is associated with. :param username: :return: a user's roles setMap ^^^^^^ .. java:method:: public void setMap(Map map) :outertype: UserSource Configure this user source. The needed parameters are to be defined and documented by the implementations. :param map: the configuration