Implement permissions API.