PermissionsTestAll: refactor code.

- remove confusing var names,
- use camel-case,
- remove iterator use for map entries,
- use enhanced for loop,
- use maps to reduce the number of vars.
Merge pull request #3087 from bpindelski/permissions_refactor

PermissionsTestAll: refactor code.