protected boolean checkResourceTypes(PrivilegeEntity entity) throws AmbariException {
    Integer resourceType           = entity.getResource().getResourceType().getId();
    Integer permissionResourceType = entity.getPermission().getResourceType().getId();

    return resourceType.equals(permissionResourceType);
  }
Check to see if the given privilege entity's permission is allowable for the
resource type.

@param entity  the privilege entity

@throws AmbariException if the the privilege permission is not allowable for the resource type
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/PrivilegeResourceProvider.java