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 withIWebEndpoint
s.- 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 String
accessDenied()
static IView
getDefaultClientView()
static String
getDefaultUriForAuthenticatedUser(IUser user)
static String
getLoginUri(IUser user)
Returns the default login URI for the given user.static String
getLoginUri(IWebEndpoint endpoint)
Returns the default login URI for the given web endpoint.static String
getScopeIdentitfier(Mandant client)
static String
getViewUriWithContext(javax.servlet.http.HttpServletRequest request, IView view)
static boolean
isPublic(IWebEndpoint endpoint)
Checks if the given endpoint is 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.static boolean
isWebEndpointAvailable(IWebEndpoint endpoint, IAvailabilityContext context)
Checks if the given web endpoint is available within the given context.static String
notFound()
static String
serverError()
-
-
-
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()
-
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 andfalse
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 andfalse
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 andfalse
otherwise.
-
-