@Override
  public Set<Resource> getResources(Request request, Predicate predicate)
      throws SystemException, UnsupportedPropertyException, NoSuchResourceException, NoSuchParentResourceException {
    Authentication authentication = AuthorizationHelper.getAuthentication();

    if (authentication == null || !authentication.isAuthenticated()) {
      throw new AuthorizationException("Authentication data is not available, authorization to perform the requested operation is not granted");
    } else if (!isAuthorizedToGetResources(authentication, request, predicate)) {
      throw new AuthorizationException("The authenticated user does not have the appropriate authorizations to get the requested resource(s)");
    }

    return getResourcesAuthorized(request, predicate);
  }
Get a set of {@link Resource resources} based on the given request and predicate
information.
</p>
Note that it is not required for this resource provider to completely filter
the set of resources based on the given predicate.  It may not be possible
since some of the properties involved may be provided by another
{@link PropertyProvider provider}.  This partial filtering is allowed because
the predicate will always be applied by the calling cluster controller.  The
predicate is made available at this level so that some pre-filtering can be done
as an optimization.
</p>
A simple implementation of a resource provider may choose to just return all of
the resources of a given type and allow the calling cluster controller to filter
based on the predicate.
<p/>
This implementation attempts to authorize the authenticated user before performing the requested
operation. If authorization fails, an AuthorizationException will be thrown.
<p/>
This method may be overwritten by implementing classes to avoid performing authorization checks
to get resources.

@param request   the request object which defines the desired set of properties
@param predicate the predicate object which can be used to filter which
                 resources are returned
@return a set of resources based on the given request and predicate information
@throws SystemException               an internal system exception occurred
@throws UnsupportedPropertyException  the request contains unsupported property ids
@throws NoSuchResourceException       the requested resource instance doesn't exist
@throws NoSuchParentResourceException a parent resource of the requested resource doesn't exist
@throws AuthorizationException        if the authenticated user is not authorized to perform this operation
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractAuthorizedResourceProvider.java