Feature/permissions

I believe this is ready for merging into develop.