Пример #1
0
        public IQueryable <InvolvementCurrent> DefineModelList(bool useOrgFilter)
        {
            var limitvisibility = Util2.OrgLeadersOnly || !HttpContextFactory.Current.User.IsInRole("Access");
            var oids            = new int[0];

            if (Util2.OrgLeadersOnly)
            {
                oids = CurrentDatabase.GetLeaderOrgIds(Util.UserPeopleId);
            }

            var roles = CurrentDatabase.CurrentRoles();

            return(from om in CurrentDatabase.InvolvementCurrent(PeopleId, Util.UserId)
                   where (om.Pending ?? false) == false
                   where oids.Contains(om.OrganizationId) || !(limitvisibility && om.SecurityTypeId == 3)
                   where om.LimitToRole == null || roles.Contains(om.LimitToRole)
                   where (!useOrgFilter || !OrgTypesFilter.Any() || OrgTypesFilter.Contains(om.OrgType))
                   select om);
        }