private bool CheckAccessLevel(UserVisibilityMode VisibilityMode, Entities.Users.UserInfo AccessingUser) { if (String.IsNullOrEmpty(strAdministratorRoleName) && !AccessingUser.IsSuperUser) { PortalInfo ps = new PortalController().GetPortal(objUser.PortalID); strAdministratorRoleName = ps.AdministratorRoleName; } return VisibilityMode == UserVisibilityMode.AllUsers || (VisibilityMode == UserVisibilityMode.MembersOnly && AccessingUser != null && AccessingUser.UserID != -1) || (AccessingUser.IsSuperUser || objUser.UserID == AccessingUser.UserID || AccessingUser.IsInRole(strAdministratorRoleName)); }