Class DatabaseHome
java.lang.Object
fr.paris.lutece.plugins.mylutece.modules.database.authentication.business.DatabaseHome
This class provides instances management methods (create, find, ...) for databaseUser objects
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddGroupForUser(int nIdUser, String strGroupKey, fr.paris.lutece.portal.service.plugin.Plugin plugin) Assign a group to userstatic voidaddRoleForUser(int nIdUser, String strRoleKey, fr.paris.lutece.portal.service.plugin.Plugin plugin) Assign a role to userstatic Collection<BaseUser>findDatabaseUsersList(fr.paris.lutece.portal.service.plugin.Plugin plugin, fr.paris.lutece.portal.service.security.LuteceAuthentication authenticationService) Load the list ofBaseUserstatic Collection<String>findDatabaseUsersListForRoleKey(String strRoleKey, fr.paris.lutece.portal.service.plugin.Plugin plugin) Returns a collection of DatabaseUser objects for a Lutece rolestatic List<DatabaseUser>findGroupUsersFromGroupKey(String strGroupKey, fr.paris.lutece.portal.service.plugin.Plugin plugin) Find assigned users to the given groupstatic BaseUserfindLuteceUserByLogin(String strLogin, fr.paris.lutece.portal.service.plugin.Plugin plugin, fr.paris.lutece.portal.service.security.LuteceAuthentication authenticationService) Find users by loginstatic TimestampfindPasswordMaxValideDateFromLogin(String strLogin, fr.paris.lutece.portal.service.plugin.Plugin plugin) Gets the expiration date of the user's passwordstatic booleanfindResetPasswordFromLogin(String strLogin, fr.paris.lutece.portal.service.plugin.Plugin plugin) Gets the reset password attribute of the user from his loginfindUserGroupsFromLogin(String strLogin, fr.paris.lutece.portal.service.plugin.Plugin plugin) Find user's groups by loginstatic intfindUserIdFromLogin(String strLogin, fr.paris.lutece.portal.service.plugin.Plugin plugin) Get the id of a user from his loginfindUserRolesFromLogin(String strLogin, fr.paris.lutece.portal.service.plugin.Plugin plugin) Find user's roles by loginstatic voidremoveGroupsForUser(int nIdUser, fr.paris.lutece.portal.service.plugin.Plugin plugin) Delete groups for a userstatic voidremoveRolesForUser(int nIdUser, fr.paris.lutece.portal.service.plugin.Plugin plugin) Delete roles for a userstatic voidupdateResetPasswordFromLogin(String strUserName, boolean bNewValue, fr.paris.lutece.portal.service.plugin.Plugin plugin) Update the reset password attribut of a user from his login
-
Method Details
-
findLuteceUserByLogin
public static BaseUser findLuteceUserByLogin(String strLogin, fr.paris.lutece.portal.service.plugin.Plugin plugin, fr.paris.lutece.portal.service.security.LuteceAuthentication authenticationService) Find users by login- Parameters:
strLogin- the loginplugin- The Plugin using this data access serviceauthenticationService- the LuteceAuthentication object- Returns:
- DatabaseUser the user corresponding to the login
-
findResetPasswordFromLogin
public static boolean findResetPasswordFromLogin(String strLogin, fr.paris.lutece.portal.service.plugin.Plugin plugin) Gets the reset password attribute of the user from his login- Parameters:
strLogin- the loginplugin- The Plugin using this data access service- Returns:
- True if the password has to be changed, false otherwise
-
findPasswordMaxValideDateFromLogin
public static Timestamp findPasswordMaxValideDateFromLogin(String strLogin, fr.paris.lutece.portal.service.plugin.Plugin plugin) Gets the expiration date of the user's password- Parameters:
strLogin- The login of the userplugin- The plugin- Returns:
- The expiration date of the user's password
-
findDatabaseUsersList
public static Collection<BaseUser> findDatabaseUsersList(fr.paris.lutece.portal.service.plugin.Plugin plugin, fr.paris.lutece.portal.service.security.LuteceAuthentication authenticationService) Load the list ofBaseUser- Parameters:
plugin- The Plugin using this data access serviceauthenticationService- the authentication service- Returns:
- The Collection of the
BaseUser
-
findUserRolesFromLogin
public static List<String> findUserRolesFromLogin(String strLogin, fr.paris.lutece.portal.service.plugin.Plugin plugin) Find user's roles by login- Parameters:
strLogin- the loginplugin- The Plugin using this data access service- Returns:
- ArrayList the role key list corresponding to the login
-
removeRolesForUser
public static void removeRolesForUser(int nIdUser, fr.paris.lutece.portal.service.plugin.Plugin plugin) Delete roles for a user- Parameters:
nIdUser- The id of the userplugin- The Plugin using this data access service
-
addRoleForUser
public static void addRoleForUser(int nIdUser, String strRoleKey, fr.paris.lutece.portal.service.plugin.Plugin plugin) Assign a role to user- Parameters:
nIdUser- The id of the userstrRoleKey- The key of the roleplugin- The Plugin using this data access service
-
findUserGroupsFromLogin
public static List<String> findUserGroupsFromLogin(String strLogin, fr.paris.lutece.portal.service.plugin.Plugin plugin) Find user's groups by login- Parameters:
strLogin- the loginplugin- The Plugin using this data access service- Returns:
- ArrayList the group key list corresponding to the login
-
removeGroupsForUser
public static void removeGroupsForUser(int nIdUser, fr.paris.lutece.portal.service.plugin.Plugin plugin) Delete groups for a user- Parameters:
nIdUser- The id of the userplugin- The Plugin using this data access service
-
addGroupForUser
public static void addGroupForUser(int nIdUser, String strGroupKey, fr.paris.lutece.portal.service.plugin.Plugin plugin) Assign a group to user- Parameters:
nIdUser- The id of the userstrGroupKey- The key of the groupplugin- The Plugin using this data access service
-
findDatabaseUsersListForRoleKey
public static Collection<String> findDatabaseUsersListForRoleKey(String strRoleKey, fr.paris.lutece.portal.service.plugin.Plugin plugin) Returns a collection of DatabaseUser objects for a Lutece role- Parameters:
strRoleKey- The role of the databseUserplugin- The current plugin using this method- Returns:
- A collection of logins
-
findGroupUsersFromGroupKey
public static List<DatabaseUser> findGroupUsersFromGroupKey(String strGroupKey, fr.paris.lutece.portal.service.plugin.Plugin plugin) Find assigned users to the given group- Parameters:
strGroupKey- The group keyplugin- Plugin- Returns:
- a list of DatabaseUser
-
updateResetPasswordFromLogin
public static void updateResetPasswordFromLogin(String strUserName, boolean bNewValue, fr.paris.lutece.portal.service.plugin.Plugin plugin) Update the reset password attribut of a user from his login- Parameters:
strUserName- Login of the user to updatebNewValue- New valueplugin- the plugin
-
findUserIdFromLogin
public static int findUserIdFromLogin(String strLogin, fr.paris.lutece.portal.service.plugin.Plugin plugin) Get the id of a user from his login- Parameters:
strLogin- Login of the userplugin- The plugin- Returns:
- The id of the user
-