Beispiel #1
0
        public async Task <IActionResult> Edit(int id)
        {
            var po = purchaseOrders.FindById(id);

            IAttributeValueProvider context = new EditPurchaseOrderAuthorizationContext("Edit")
            {
                PurchaseOrderDepartment = po.Department,
            };

            var authorizationResult = await pep.Evaluate(context);

            if (authorizationResult.Outcome != PolicyOutcome.Permit)
            {
                return(AuthorizationFailed(authorizationResult));
            }

            return(View("PurchaseOrder", po));
        }
        public async Task <IActionResult> Edit(int id)
        {
            var po = purchaseOrders.FindById(id);

            return(View("PurchaseOrder", po));
        }