Implement API endpoint to query permissions.