Class JKUserWebControllers
java.lang.Object
com.jk.web.faces.controllers.JKWebController
com.jk.webstack.controllers.JKWebAppBaseController
com.jk.webstack.controllers.JKWebControllerWithSqlDataAccess
com.jk.webstack.controllers.JKWebControllerWithOrmSupport<User>
com.jk.webstack.security.controllers.JKUserWebControllers
- All Implemented Interfaces:
Serializable
@Named("usersController")
@ViewScoped
public class JKUserWebControllers
extends JKWebControllerWithOrmSupport<User>
This class is responsible for managing user-related operations in a web
application.
It is used for tasks such as changing passwords, checking user roles, and handling user data.
This class extends the JKWebControllerWithOrmSupport
class for web
functionality and ORM support.
- Version:
- 1.0
- Author:
- Dr. Jalal H. Kiswani
- See Also:
-
Field Summary
Fields inherited from class com.jk.webstack.controllers.JKWebControllerWithOrmSupport
mode
Fields inherited from class com.jk.webstack.controllers.JKWebControllerWithSqlDataAccess
sqlDataAccess
Fields inherited from class com.jk.web.faces.controllers.JKWebController
logger
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
This method is a callback method executed before inserting a new user.protected void
This method is a callback method executed before updating an existing user.This method change the user's password.This method gets the current password.This method get the error message related to authentication.This method gets the new password.protected SecurityService
This method get the SecurityService instance.getUser()
This method gets the currently logged-in user.boolean
isAdmin()
This method check if the current user is an administrator.reset()
This method reset the new password field.void
setCurrentPassword
(String currentPassword) This method sets the current password.void
setNewPassword
(String newPassword) This method sets the new password.Methods inherited from class com.jk.webstack.controllers.JKWebControllerWithOrmSupport
add, addToDatabase, afterDelete, afterFind, afterInsert, afterUpdate, approvePayload, beforeDelete, beforeFind, cancelEdit, createEmptyModel, delete, deleteFromDatabase, duplicate, edit, fill, find, findPayload, getDataAccess, getDataList, getDataListFilter, getEmptyModel, getFilterList, getFilterList2, getIdValue, getIdValue, getMode, getModel, getModelClass, getModelList, getModelListFilter, getOriginal, getPayload, getPayloads, getWorkflowEntityName, isAllowAdd, isAllowDelete, isAllowEdit, isAllowFill, isAllowReset, isAllowSave, isAlwaysRefreshList, isConfirmReeset, isEditMode, isEditTabular, isFieldModified, isInputDisabled, isReadOnlyMode, isWorkflowAvialable, postConstruct, rejectPayload, resetData, resetWorkFlow, save, saveAll, saveAllToDatabase, saveToDatabase, setAlwaysRefreshList, setConfirmReeset, setDataList, setDataListFilter, setEditTabular, setFilterList, setFilterList2, setIdValue, setModel, setModelListFilter, setOriginal, setPayload, setPayloads, viewPayload
Methods inherited from class com.jk.webstack.controllers.JKWebControllerWithSqlDataAccess
execute, getSqlDataAccess
Methods inherited from class com.jk.webstack.controllers.JKWebAppBaseController
getActionLogName, getActionLogService, getEmail, getEmailService, getFamilyName, getFirstName, getIdToken, getUserName, isUserLoggedIn, logAction
Methods inherited from class com.jk.web.faces.controllers.JKWebController
context, error, error, executeAsyc, getContextParam, getContextPath, getFromAppliaction, getFromRequest, getFromSession, getParam, getParamterFromRequest, getRoles, getTenantId, getViewScopedManagedBean, handleException, init, isDebug, isDevelopmentMode, redirect, request, session, showErrorDialogMessage, showInfoDialogMessage, showWarningDialogMessage, success, success, suggestName, updateUi, warning
-
Constructor Details
-
JKUserWebControllers
public JKUserWebControllers()
-
-
Method Details
-
getMessage
This method get the error message related to authentication.- Returns:
- the error message or null if no error occurred.
-
getUser
This method gets the currently logged-in user.- Returns:
- the User object representing the logged-in user or null if not logged in.
-
getService
This method get the SecurityService instance.- Returns:
- the SecurityService instance for managing security-related tasks.
-
getCurrentPassword
This method gets the current password.- Returns:
- the current password.
-
setCurrentPassword
This method sets the current password.- Parameters:
currentPassword
- Specifies the new current password.
-
getNewPassword
This method gets the new password.- Returns:
- the new password.
-
setNewPassword
This method sets the new password.- Parameters:
newPassword
- Specifies the new password.
-
changePassword
This method change the user's password.- Returns:
- the string
dashboard
if the password changed, or null if it couldn't be changed.
-
isAdmin
public boolean isAdmin()This method check if the current user is an administrator.- Returns:
- true, if the current user is an administrator, false otherwise.
-
beforeInsert
protected void beforeInsert()This method is a callback method executed before inserting a new user.- Overrides:
beforeInsert
in classJKWebControllerWithOrmSupport<User>
-
beforeUpdate
protected void beforeUpdate()This method is a callback method executed before updating an existing user.- Overrides:
beforeUpdate
in classJKWebControllerWithOrmSupport<User>
-
reset
This method reset the new password field.- Overrides:
reset
in classJKWebControllerWithOrmSupport<User>
- Returns:
- null.
-