Class SecurityWebEndpointHelper


  • public class SecurityWebEndpointHelper
    extends Object
    Helper for working with IWebEndpoints.
    Since:
    8.0.0
    Author:
    XIMA Media GmbH
    • Constructor Detail

      • SecurityWebEndpointHelper

        public SecurityWebEndpointHelper()
    • Method Detail

      • accessDenied

        public static String accessDenied()
      • notFound

        public static String notFound()
      • serverError

        public static String serverError()
      • getViewUriWithContext

        public static String getViewUriWithContext​(javax.servlet.http.HttpServletRequest request,
                                                   IView view)
      • getLoginUri

        public static String getLoginUri​(IWebEndpoint endpoint)
        Returns the default login URI for the given web endpoint. Different web endpoints can have different login URIs.
        Parameters:
        endpoint - the web endpoint to get the login uri for.
        Returns:
        the login URI for the given web endpoint.
      • getLoginUri

        public static String getLoginUri​(IUser user)
        Returns the default login URI for the given user. The login URI depends on the authentication context of the user.
        Parameters:
        user - to get the login uri for
        Returns:
        the login uri for the given user.
      • getDefaultUriForAuthenticatedUser

        public static String getDefaultUriForAuthenticatedUser​(IUser user)
      • getDefaultClientView

        public static IView getDefaultClientView()
      • getScopeIdentitfier

        public static String getScopeIdentitfier​(Mandant client)
      • isWebEndpointAvailable

        public static boolean isWebEndpointAvailable​(IWebEndpoint endpoint,
                                                     IAvailabilityContext context)
        Checks if the given web endpoint is available within the given context.
        Parameters:
        endpoint - to check.
        context - holds information about the context that is to be checked.
        Returns:
        true if the given web endpoint is available in the given context and false otherwise.
      • isUserAuthorized

        public static boolean isUserAuthorized​(IWebEndpoint endpoint,
                                               IAuthorizationContext context,
                                               IUser user)
        Checks if the given user has authorization for the given web endpoint within the given context.
        Parameters:
        endpoint - to check.
        context - holds information about the context that is to be checked (e.g. the current client)
        user - to check.
        Returns:
        true if the given user has authorization to the given web endpoint within the context and false otherwise.
      • isPublic

        public static boolean isPublic​(IWebEndpoint endpoint)
        Checks if the given endpoint is public.
        Parameters:
        endpoint - to check.
        Returns:
        true if the given web endpoint is a public web endpoint and false otherwise.