Exemplo n.º 1
0
        public ActionResult SavePolicy(UserMenuPolicyInfo model)
        {
            if (!ModelState.IsValid)
            {
                return(this.InvalidModelState());
            }

            MenuAccessPolicyModel.Save(model);
            return(this.Ok("OK"));
        }
Exemplo n.º 2
0
        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"));
        }
Exemplo n.º 4
0
 public static async Task SaveAsync(string tenant, UserMenuPolicyInfo model)
 {
     await Menus.SavePolicyAsync(tenant, model.OfficeId, model.UserId, model.Allowed, model.Disallowed).ConfigureAwait(false);
 }
Exemplo n.º 5
0
 public static void Save(UserMenuPolicyInfo model)
 {
     Menus.SavePolicy(model.OfficeId, model.UserId, model.Allowed, model.Disallowed);
 }