Class 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 Detail

      • SessionUserManager

        public SessionUserManager()
    • Method Detail

      • getUser

        public IUser getUser()
      • isSystemAdmin

        public boolean isSystemAdmin()
      • isSuperUser

        public boolean isSuperUser()
      • isInvitedUser

        public boolean isInvitedUser()
      • hasProfile

        public boolean hasProfile()
        Checks if the user has a profile.
        Returns:
        true if the user has a profile, false otherwise.
      • 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.
        Use logoutWithTarget(String, boolean) instead. The redirect URL is now specified by the CmnConst.Security.Authentication.AUTH_PARAM_REDIRECT_TARGET parameter, 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 enum EPublicView. 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