public final class JahiaControllerUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
checkUserAuthorized(JahiaUser user,
String permissions) |
static void |
checkUserAuthorized(JCRNodeWrapper node,
JahiaUser user,
String permissions) |
static void |
checkUserLoggedIn(JahiaUser user) |
static int |
getIntParameter(javax.servlet.http.HttpServletRequest request,
String name)
Simple utility method to retrieve an integer parameter from a request and throws an
JahiaBadRequestException (results in a 400 error)
in case the parameter is not found. |
static int |
getIntParameter(javax.servlet.http.HttpServletRequest request,
String name,
int defaultValue)
Retrieves the integer value of the specified request parameter.
|
static String |
getParameter(javax.servlet.http.HttpServletRequest request,
String name)
Simple utility method to retrieve a parameter from a request and throws an
JahiaBadRequestException (results in a 400 error)
in case the parameter is not found. |
static String |
getParameter(javax.servlet.http.HttpServletRequest request,
String name,
String defaultValue)
Retrieves the value of the specified request parameter.
|
static boolean |
hasRequiredPermission(JahiaUser user,
String permissions) |
static boolean |
hasRequiredPermission(JCRNodeWrapper node,
JahiaUser user,
String permissions) |
public static void checkUserAuthorized(JahiaUser user, String permissions) throws JahiaForbiddenAccessException
JahiaForbiddenAccessExceptionpublic static void checkUserAuthorized(JCRNodeWrapper node, JahiaUser user, String permissions) throws JahiaForbiddenAccessException
JahiaForbiddenAccessExceptionpublic static void checkUserLoggedIn(JahiaUser user) throws JahiaForbiddenAccessException
JahiaForbiddenAccessExceptionpublic static final int getIntParameter(javax.servlet.http.HttpServletRequest request,
String name)
throws JahiaBadRequestException
JahiaBadRequestException (results in a 400 error)
in case the parameter is not found.request - The current HttpServletRequestname - The parameter nameJahiaBadRequestException - in case the parameter is not found in the request or a parsing exception occurspublic static final int getIntParameter(javax.servlet.http.HttpServletRequest request,
String name,
int defaultValue)
request - The current HttpServletRequestname - The parameter namedefaultValue - the default parameter valuepublic static final String getParameter(javax.servlet.http.HttpServletRequest request, String name) throws JahiaBadRequestException
JahiaBadRequestException (results in a 400 error)
in case the parameter is not found.request - The current HttpServletRequestname - The parameter nameJahiaBadRequestException - in case the parameter is not found in the requestpublic static final String getParameter(javax.servlet.http.HttpServletRequest request, String name, String defaultValue)
request - The current HttpServletRequestname - The parameter namedefaultValue - the default parameter valuepublic static boolean hasRequiredPermission(JahiaUser user, String permissions) throws javax.jcr.RepositoryException
javax.jcr.RepositoryExceptionpublic static boolean hasRequiredPermission(JCRNodeWrapper node, JahiaUser user, String permissions) throws javax.jcr.RepositoryException
javax.jcr.RepositoryExceptionCopyright © 2004–2020 Jahia Solutions Group SA. All rights reserved.