improve user roles related code

note - found that git is buggy again when text=auto, disabled it in
.gitattributes
Merge branch 'master' of https://github.com/jojosati/npd-tvs