示例#1
0
        public static void RegisterUserTypeCondition(SchemaBuilder sb, TypeConditionSymbol typeCondition)
        {
            sb.Schema.Settings.AssertImplementedBy((UserQueryEntity uq) => uq.Owner, typeof(UserEntity));

            TypeConditionLogic.RegisterCompile<UserQueryEntity>(typeCondition,
                uq => uq.Owner.RefersTo(UserEntity.Current));
        }
示例#2
0
        public static void RegisterRoleTypeCondition(SchemaBuilder sb, TypeConditionSymbol typeCondition)
        {
            sb.Schema.Settings.AssertImplementedBy((UserQueryEntity uq) => uq.Owner, typeof(RoleEntity));

            TypeConditionLogic.RegisterCompile<UserQueryEntity>(typeCondition,
                uq => AuthLogic.CurrentRoles().Contains(uq.Owner));
        }
 public TypeConditionRuleBuilder(TypeConditionSymbol typeCondition, TypeAllowed allowed)
 {
     this.TypeCondition = typeCondition;
     this.Allowed = new TypeAllowedBuilder(allowed);
 }