Permission edit almost complete - check for bugs & optimiseation + bugfix to registration