Added permission system

Todo: Clean this mess up