Adds authentication checks and filtering for relations