public IActionResult Check(string Path) { var UserID = HttpContext.Items["UserID"]; var RoleID = HttpContext.Items["RoleID"]; if (UserID == null || RoleID == null) { return(Json(new { status = 403, message = "Forhibben" })); } var validpath = _author.CheckAuthorPath(int.Parse(RoleID.ToString()), Path); if (validpath) { return(Json(new { status = 200, message = "Allow connect" })); } return(Json(new { status = 403, message = "Forhibben" })); }