Package de.xima.fc.security.helper
Class SecurityWebEndpointHelper
- java.lang.Object
-
- de.xima.fc.security.helper.SecurityWebEndpointHelper
-
public class SecurityWebEndpointHelper extends Object
Helper for working withIWebEndpoints.- Since:
- 8.0.0
- Author:
- XIMA Media GmbH
-
-
Constructor Summary
Constructors Constructor Description SecurityWebEndpointHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringaccessDenied()static IViewgetDefaultClientView()static StringgetDefaultUriForAuthenticatedUser(IUser user)static StringgetLoginUri(IUser user)Returns the default login URI for the given user.static StringgetLoginUri(IWebEndpoint endpoint)Returns the default login URI for the given web endpoint.static StringgetScopeIdentitfier(Mandant client)static StringgetViewUriWithContext(javax.servlet.http.HttpServletRequest request, IView view)static booleanisPublic(IWebEndpoint endpoint)Checks if the given endpoint is public.static booleanisUserAuthorized(IWebEndpoint endpoint, IAuthorizationContext context, IUser user)Checks if the given user has authorization for the given web endpoint within the given context.static booleanisWebEndpointAvailable(IWebEndpoint endpoint, IAvailabilityContext context)Checks if the given web endpoint is available within the given context.static StringnotFound()static StringserverError()
-
-
-
Method Detail
-
accessDenied
public static final String accessDenied()
-
notFound
public static final String notFound()
-
serverError
public static final String serverError()
-
getViewUriWithContext
public static final 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()
-
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:
trueif the given web endpoint is available in the given context andfalseotherwise.
-
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:
trueif the given user has authorization to the given web endpoint within the context andfalseotherwise.
-
isPublic
public static boolean isPublic(IWebEndpoint endpoint)
Checks if the given endpoint is public.- Parameters:
endpoint- to check.- Returns:
trueif the given web endpoint is a public web endpoint andfalseotherwise.
-
-