Closes #8: simplify permissions
Fix functional test
Closes #6: add separate permissions for protected refs