Check permissions on providers/consumers

Fixes #1987