protect against nil permissions

fixes #422 

- [x] stop introducing nil permissions in resourcespec
- [x] resourcemanager check again for nil before using