Exemple #1
0
        public ClaimItem([NotNull] string claim, ClaimItemType type, string parent = null)
        {
            Check.NotNull(claim, nameof(claim));

            this.Claim  = claim;
            this.Type   = type;
            this.Parent = parent;

            this.Sort = _sort++;
        }
Exemple #2
0
        public IQueryable <ClaimItem> GetAll(ClaimItemType claimItemType)
        {
            // 如果筛选类型为 Host 但是没有开启多租户,那么修改类型为 Tenant
            if (claimItemType == ClaimItemType.Host && !Riven.MultiTenancy.MultiTenancyConfig.IsEnabled)
            {
                claimItemType = ClaimItemType.Tenant;
            }

            return(_claims.Where(o => o.Type == ClaimItemType.Common || o.Type == claimItemType)
                   .OrderBy(o => o.Sort)
                   .AsQueryable());
        }