Package org.apache.ofbiz.security
Class SecurityUtil
- java.lang.Object
-
- org.apache.ofbiz.security.SecurityUtil
-
public final class SecurityUtil extends java.lang.Object
ASecurity
util.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
module
-
Constructor Summary
Constructors Constructor Description SecurityUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
authenticateUserLoginByJWT(Delegator delegator, java.lang.String userLoginId, java.lang.String jwtToken)
For a jwtToken and userLoginId check the coherence between themstatic boolean
containsFreemarkerInterpolation(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp, java.lang.String uri)
static boolean
containsFreemarkerInterpolation(javax.servlet.http.HttpServletResponse resp, java.lang.String stringToCheck)
static java.lang.String
generateJwtToAuthenticateUserLogin(Delegator delegator, java.lang.String userLoginId)
Return a JWToken for authenticate a userLogin with salt the token by userLoginId and currentPasswordstatic boolean
hasUserLoginAdminPermission(Delegator delegator, java.lang.String userLoginId)
Return true if given userLogin possess at least one of the adminPermissionstatic java.util.List<java.lang.String>
hasUserLoginMorePermissionThan(Delegator delegator, java.lang.String userLoginId, java.lang.String toUserLoginId)
Return the list of missing permission, if toUserLoginId has more permission thant userLoginId, emptyList either.
-
-
-
Method Detail
-
hasUserLoginAdminPermission
public static boolean hasUserLoginAdminPermission(Delegator delegator, java.lang.String userLoginId)
Return true if given userLogin possess at least one of the adminPermission- Parameters:
delegator
-userLoginId
-- Returns:
- boolean
-
hasUserLoginMorePermissionThan
public static java.util.List<java.lang.String> hasUserLoginMorePermissionThan(Delegator delegator, java.lang.String userLoginId, java.lang.String toUserLoginId)
Return the list of missing permission, if toUserLoginId has more permission thant userLoginId, emptyList either.- Parameters:
delegator
-userLoginId
-toUserLoginId
-- Returns:
- List
-
generateJwtToAuthenticateUserLogin
public static java.lang.String generateJwtToAuthenticateUserLogin(Delegator delegator, java.lang.String userLoginId) throws GenericEntityException
Return a JWToken for authenticate a userLogin with salt the token by userLoginId and currentPassword- Throws:
GenericEntityException
-
authenticateUserLoginByJWT
public static boolean authenticateUserLoginByJWT(Delegator delegator, java.lang.String userLoginId, java.lang.String jwtToken)
For a jwtToken and userLoginId check the coherence between them
-
containsFreemarkerInterpolation
public static boolean containsFreemarkerInterpolation(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp, java.lang.String uri) throws java.io.IOException
- Throws:
java.io.IOException
-
containsFreemarkerInterpolation
public static boolean containsFreemarkerInterpolation(javax.servlet.http.HttpServletResponse resp, java.lang.String stringToCheck) throws java.io.IOException
- Parameters:
resp
-stringToCheck
-- Throws:
java.io.IOException
-
-