Skip to content

Commit 938a996

Browse files
Add test case for Authorize attribute
1 parent b2d5484 commit 938a996

File tree

1 file changed

+9
-0
lines changed
  • csharp/ql/test/query-tests/Security Features/CWE-285/MissingAccessControl/MVCTests

1 file changed

+9
-0
lines changed

csharp/ql/test/query-tests/Security Features/CWE-285/MissingAccessControl/MVCTests/ProfileController.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using Microsoft.AspNetCore.Mvc;
2+
using Microsoft.AspNetCore.Authorization;
23

34
public class ProfileController : Controller {
45
private void doThings() { }
@@ -18,4 +19,12 @@ public ActionResult Delete2(int id) {
1819
doThings();
1920
return View();
2021
}
22+
23+
// GOOD: The Authorize attribute is used.
24+
[Authorize]
25+
public ActionResult Delete3(int id) {
26+
doThings()
27+
return View();
28+
}
29+
2130
}

0 commit comments

Comments
 (0)