コード例 #1
0
        public ActionResult SavePolicy(int officeId, int userId, List <AccessPolicyInfo> model)
        {
            if (!ModelState.IsValid)
            {
                return(this.InvalidModelState());
            }

            EntityAccessPolicyModel.Save(officeId, userId, model);
            return(this.Ok());
        }
コード例 #2
0
        public async Task <ActionResult> SavePolicyAsync(int officeId, int userId, List <AccessPolicyInfo> model)
        {
            if (!this.ModelState.IsValid)
            {
                return(this.InvalidModelState(this.ModelState));
            }

            await EntityAccessPolicyModel.SaveAsync(this.AppUser, officeId, userId, model).ConfigureAwait(true);

            return(this.Ok());
        }
コード例 #3
0
        public async Task <ActionResult> GetPolicyAsync(int officeId, int userId)
        {
            var model = await EntityAccessPolicyModel.GetAsync(this.AppUser, officeId, userId).ConfigureAwait(true);

            return(this.Ok(model));
        }
コード例 #4
0
        public async Task <ActionResult> UserPolicyAsync()
        {
            var model = await EntityAccessPolicyModel.GetAsync(this.AppUser).ConfigureAwait(true);

            return(this.FrapidView(this.GetRazorView <AreaRegistration>("AccessPolicy/Policy.cshtml", this.Tenant), model));
        }
コード例 #5
0
        public ActionResult GetPolicy(int officeId, int userId)
        {
            var model = EntityAccessPolicyModel.Get(officeId, userId);

            return(this.Ok(model));
        }
コード例 #6
0
        public ActionResult UserPolicy()
        {
            var model = EntityAccessPolicyModel.Get();

            return(this.FrapidView(this.GetRazorView <AreaRegistration>("AccessPolicy/Policy.cshtml"), model));
        }