Refactored. Groups and Permissions loaded at login