public static void verifyAuthorization(Authentication authentication,
                                         ResourceType resourceType,
                                         Long resourceId,
                                         Set<RoleAuthorization> requiredAuthorizations)
      throws AuthorizationException {
    if (!isAuthorized(authentication, resourceType, resourceId, requiredAuthorizations)) {
      throw new AuthorizationException();
    }
  }
Determines if the specified authenticated user 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 authentication         the authenticated user and associated access privileges
@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(Authentication, ResourceType, Long, Set)
ambari-server/src/main/java/org/apache/ambari/server/security/authorization/AuthorizationHelper.java