Fix bug with derived permissions