code: public String createCondition(Authentication authentication, Object privilegeKey, SpelTranslator translator) {
          if (!hasPermission(authentication, privilegeKey)) {
              throw new AccessDeniedException("Access is denied");
          }
  
          String roleKey = getRoleKey(authentication);
  
          Permission permission = getPermission(roleKey, privilegeKey);
  
          Subject subject = getSubject(roleKey);
  
          if (!RoleConstant.SUPER_ADMIN.equals(roleKey)
              && permission != null && permission.getResourceCondition() != null) {
              return translator.translate(permission.getResourceCondition().getExpressionString(), subject);
          }
          return null;
      }
docs: Create condition with replaced subject variables.
  
  <p>SpEL condition translated to SQL condition with replacing #returnObject to returnObject
  and enriching #subject.* from Subject object (see {@link Subject}).
  
  <p>As an option, SpEL could be translated to SQL
  via {@link SpelExpression} method {@code getAST()}
  with traversing through {@link SpelNode} nodes and building SQL expression.
  
  @param authentication the authentication
  @param privilegeKey the privilege key
  @param translator the spel translator
  @return condition if permitted, or null