protected PermissionEntity getPermission(String permissionName, ResourceEntity resourceEntity)
      throws AmbariException {

    return permissionDAO.findPermissionByNameAndType(permissionName, resourceEntity.getResourceType());
  }
Convert the given map of properties to a privilege entity for the resource
identified by the given id.

@param properties  the property map
@param resourceId  the resource id

@return the new privilege entity
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/PrivilegeResourceProvider.java