Re-add permissions support that was accidentally removed
Merge branch 'permissions' into repo-api-dev