Class SecurityUtil

java.lang.Object
org.apache.ofbiz.security.SecurityUtil

public final class SecurityUtil extends Object
A Security util.
  • Constructor Details

    • SecurityUtil

      public SecurityUtil()
  • Method Details

    • hasUserLoginAdminPermission

      public static boolean hasUserLoginAdminPermission(Delegator delegator, String userLoginId)
      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