Added a basic permissions framework. This was just a test, need to add more stuff and get it fully working.