class DataAuthorizable implements Authorizable, EnforcePolicyPermissionsThroughBaseResource {

    @Override
    public AuthorizationResult checkAuthorization(Authorizer authorizer, RequestAction action, NiFiUser user, Map<String, String> resourceContext) {
        if (user == null) {
            return AuthorizationResult.denied("Unknown user.");
        }

        AuthorizationResult result = null;

        // authorize each element in the chain
        NiFiUser chainedUser = user;
        do {
            try {
                // perform the current user authorization
                result = Authorizable.super.checkAuthorization(authorizer, action, chainedUser, resourceContext);

                // if authorization is not approved, reject
                if (!Result.Approved.equals(result.getResult())) {
                    return result;
                }

                // go to the next user in the chain
                chainedUser = chainedUser.getChain();
            } catch (final ResourceNotFoundException e) {
                result = AuthorizationResult.denied("Unknown source component.");
            }
        } while (chainedUser != null);

        if (result == null) {
            result = AuthorizationResult.denied();
        }

        return result;
    }

    public  DataAuthorizable(final Authorizable authorizable);

}