docs: public static Permission getPermissionByNameAndResourceType(String permissionName, int resourceType) {
      for (Permission permission : getPermissionsByResourceType(resourceType)) {
        if (permission.getName().equals(permissionName)) {
          return permission;
        }
      }
      throw new BadUserRequestException(
          String.format("The permission '%s' is not valid for '%s' resource type.", permissionName, getResourceByType(resourceType))
          );
    }