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 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)Redirects to the logout endpoint which invalidates the session and redirects to the given URL.voidlogout(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)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
public void logout(String redirectUrl, boolean centralLogout)
Redirects to the logout endpoint which invalidates the session and redirects to the given URL.- Parameters:
redirectUrl- The URL to redirect to after logout.
-
-