public static void verifyAuthorization(ResourceType resourceType,
                                         Long resourceId,
                                         Set<RoleAuthorization> requiredAuthorizations)
      throws AuthorizationException {
    if (!isAuthorized(resourceType, resourceId, requiredAuthorizations)) {
      throw new AuthorizationException();
    }
  }
Determines if the authenticated user (from application's security context) is authorized to
perform an operation on the the specific resource by matching the authenticated user's
authorizations with one from the provided set of authorizations.
<p/>
If not authorized, an {@link AuthorizationException} will be thrown.

@param resourceType           a resource type being acted upon
@param resourceId             the privilege resource id (or adminresource.id) of the relevant resource
@param requiredAuthorizations a set of requirements for which one match will allow authorization
@throws AuthorizationException if authorization is not granted
@see #isAuthorized(ResourceType, Long, Set)
ambari-server/src/main/java/org/apache/ambari/server/security/authorization/AuthorizationHelper.java