Package org.apache.ofbiz.security
Class SecurityUtil
java.lang.Object
org.apache.ofbiz.security.SecurityUtil
A
Security
util.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
authenticateUserLoginByJWT
(Delegator delegator, String userLoginId, String jwtToken) For a jwtToken and userLoginId check the coherence between themstatic String
generateJwtToAuthenticateUserLogin
(Delegator delegator, String userLoginId) Return a JWToken for authenticate a userLogin with salt the token by userLoginId and currentPasswordstatic boolean
hasUserLoginAdminPermission
(Delegator delegator, String userLoginId) Return true if given userLogin possess at least one of the adminPermissionhasUserLoginMorePermissionThan
(Delegator delegator, String userLoginId, String toUserLoginId) Return the list of missing permission, if toUserLoginId has more permission thant userLoginId, emptyList either.
-
Constructor Details
-
SecurityUtil
public SecurityUtil()
-
-
Method Details
-
hasUserLoginAdminPermission
Return true if given userLogin possess at least one of the adminPermission- Parameters:
delegator
-userLoginId
-- Returns:
- boolean
-
hasUserLoginMorePermissionThan
public static List<String> hasUserLoginMorePermissionThan(Delegator delegator, String userLoginId, 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 String generateJwtToAuthenticateUserLogin(Delegator delegator, 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, String userLoginId, String jwtToken) For a jwtToken and userLoginId check the coherence between them
-