public static PropertyRulePack GetPropertyRules(Lite <RoleEntity> role, TypeEntity typeEntity) { var result = new PropertyRulePack { Role = role, Type = typeEntity }; cache.GetRules(result, PropertyRouteLogic.RetrieveOrGenerateProperties(typeEntity)); var coercer = PropertyCoercer.Instance.GetCoerceValue(role); result.Rules.ForEach(r => r.CoercedValues = EnumExtensions.GetValues <PropertyAllowed>() .Where(a => !coercer(PropertyRouteEntity.ToPropertyRouteFunc(r.Resource), a).Equals(a)) .ToArray()); return(result); }
public static void SetPropertyRules(PropertyRulePack rules) { cache.SetRules(rules, r => r.RootType == rules.Type); }
public void SetPropertyRules(PropertyRulePack rules) { Execute(MethodInfo.GetCurrentMethod(), () => PropertyAuthLogic.SetPropertyRules(rules)); }
public void SetPropertyRule([Required, FromBody] PropertyRulePack rules) { BasicPermission.AdminRules.AssertAuthorized(); PropertyAuthLogic.SetPropertyRules(rules); Schema.Current.InvalidateMetadata(); }
public void SetPropertyRule(PropertyRulePack rules) { BasicPermission.AdminRules.AssertAuthorized(); PropertyAuthLogic.SetPropertyRules(rules); }
public void SetPropertyRule(PropertyRulePack rules) { BasicPermission.AdminRules.AssertAuthorized(); PropertyAuthLogic.SetPropertyRules(rules); }