// TODO: Remember to refactor code!!! public UserIdentity(int userId, UserAccountService service, UserInfo userInfo, string store, string application) { //Assign the incoming user name to the current one and clear the roles collection var user = service.GetUserDetail(userId); this.userName = user.UserName; this._profile = userInfo; this.roles.Clear(); authenticated = true; /* Retrive the list of all authorized Tasks and Operations from NetSqlAzMan database * and persist it with the roles arraylist collection */ roles.AddRange(service.GetUserPermissions(userInfo.UserName, "CATS", application)); }