Package de.xima.fc.security.user
Class SessionUserManager
- java.lang.Object
-
- de.xima.fc.security.user.SessionUserManager
-
- All Implemented Interfaces:
Serializable
@Named @SessionScoped public class SessionUserManager extends Object implements Serializable
Manager for working with user that is authenticated within a backend session.- Since:
- 8.0.0
- Author:
- XIMA Media GmbH
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SessionUserManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidclear()UserProfilePreferencesgetPreferences()IUsergetUser()booleanhasProfile()Checks if the user has a profile.booleanisInvitedUser()booleanisMe(IEntityClientAuthorization authorization)booleanisMe(IUserIdentity identity)booleanisMe(UserProfile profile)booleanisSuperUser()booleanisSystemAdmin()voidlogout()Logs out the current user and redirects to either the external projects view or the welcome view, depending on the current view.voidlogout(String redirectUrl, boolean centralLogout)Deprecated, for removal: This API element is subject to removal in a future version.UselogoutWithTarget(String, boolean)instead.voidlogout(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)voidlogoutWithTarget(String targetView, boolean centralLogout)Redirects to the logout endpoint which invalidates the session and redirects to the given target view.voidrefresh()voidrefresh(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)voidsoftLogout()voidupdatePreferences(Consumer<UserProfilePreferences> update)
-
-
-
Method Detail
-
getUser
public IUser getUser()
-
isSystemAdmin
public boolean isSystemAdmin()
-
isSuperUser
public boolean isSuperUser()
-
isInvitedUser
public boolean isInvitedUser()
-
getPreferences
public UserProfilePreferences getPreferences()
-
hasProfile
public boolean hasProfile()
Checks if the user has a profile.- Returns:
trueif the user has a profile,falseotherwise.
-
isMe
public boolean isMe(UserProfile profile)
-
isMe
public boolean isMe(IUserIdentity identity)
-
isMe
public boolean isMe(IEntityClientAuthorization authorization)
-
updatePreferences
public void updatePreferences(Consumer<UserProfilePreferences> update)
-
clear
public void clear()
-
refresh
public void refresh()
-
refresh
public void refresh(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
-
softLogout
public void softLogout()
-
logout
public void logout(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
-
logout
public void logout()
Logs out the current user and redirects to either the external projects view or the welcome view, depending on the current view.
-
logout
@Deprecated(since="8.6.0", forRemoval=true) public void logout(String redirectUrl, boolean centralLogout)
Deprecated, for removal: This API element is subject to removal in a future version.UselogoutWithTarget(String, boolean)instead. The redirect URL is now specified by theCmnConst.Security.Authentication.AUTH_PARAM_REDIRECT_TARGETparameter, which does not allow an URL. This method will only redirect to the welcome page now.Redirects to the logout endpoint which invalidates the session and redirects to the given URL.- Parameters:
redirectUrl- The URL to redirect to after logout.centralLogout- Whether to perform a central logout.
-
logoutWithTarget
public void logoutWithTarget(String targetView, boolean centralLogout)
Redirects to the logout endpoint which invalidates the session and redirects to the given target view. The target view is specified by its name of the enumEPublicView. Currently, only EXTERNAL and WELCOME are supported.- Parameters:
targetView- The view to redirect to after logout.centralLogout- Whether to perform a central logout.- Since:
- 8.6.0
-
-