Manage permissions refactoring

yay, got it finally.. Please don't check the single commits ;) I've introduces a bunch of bugs but fixed them later :P