public ActionResult SavePolicy(UserMenuPolicyInfo model) { if (!ModelState.IsValid) { return(this.InvalidModelState()); } MenuAccessPolicyModel.Save(model); return(this.Ok("OK")); }
public static async Task SaveAsync(string tenant, UserMenuPolicyInfo model) { await Menus.SavePolicyAsync(tenant, model.OfficeId, model.UserId, model.Allowed, model.Disallowed).ConfigureAwait(false); //Invalidate existing cache data string prefix = $"menu_policy_{tenant}_{model.OfficeId}_{model.UserId}"; var factory = new DefaultCacheFactory(); factory.RemoveByPrefix(prefix); }
public async Task <ActionResult> SavePolicyAsync(UserMenuPolicyInfo model) { if (!ModelState.IsValid) { return(this.InvalidModelState(this.ModelState)); } await MenuAccessPolicyModel.SaveAsync(this.Tenant, model).ConfigureAwait(true); return(this.Ok("OK")); }
public static async Task SaveAsync(string tenant, UserMenuPolicyInfo model) { await Menus.SavePolicyAsync(tenant, model.OfficeId, model.UserId, model.Allowed, model.Disallowed).ConfigureAwait(false); }
public static void Save(UserMenuPolicyInfo model) { Menus.SavePolicy(model.OfficeId, model.UserId, model.Allowed, model.Disallowed); }