added permissions
restructure permission tests a bit