public async Task <IActionResult> Delete(RoleClaimDeleteGet RoleClaim)
        {
            var CurrentUser = await _userManager.GetUserAsync(User);

            if (await _claimCheck.CheckClaim(CurrentUser, "ApplicationRight", this.ControllerContext.RouteData.Values["controller"].ToString() + "\\" + this.ControllerContext.RouteData.Values["action"].ToString()))
            {
                //RoleClaim.CreatorId = CurrentUser.Id;
                //var CheckString = await _RoleClaimProvider.DeletePostCheck(RoleClaim);
                //if (CheckString.Length == 0)
                //{
                _roleClaimProvider.DeletePost(CurrentUser.Id, RoleClaim.RoleClaimId);
                return(Ok(RoleClaim));

                //}
                return(BadRequest(new
                {
                    IsSuccess = false,
                    //Message = CheckString,
                }));
            }
            return(BadRequest(new
            {
                IsSuccess = false,
                Message = "No rights",
            }));
        }
Exemple #2
0
        public async Task <IActionResult> Delete(RoleClaimDeleteGet RoleClaim)
        {
            var token = HttpContext.Session.GetString("Token"); if (token == null)
            {
                return(RedirectToAction("Login", "FrontAuth"));
            }
            await _client.PostProtectedAsync <RoleClaimDeleteGet>($"{_configuration["APIUrl"]}api/RoleClaim/Delete", RoleClaim, token);

            return(RedirectToAction("Index", new { id = RoleClaim.RoleId }));
        }