You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/Tests/AuthorizationTests.cs
+30Lines changed: 30 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -751,6 +751,36 @@ public async Task EndToEnd(bool authenticated)
751
751
actual.ShouldBe(@"{""errors"":[{""message"":""Access denied for field \u0027parent\u0027 on type \u0027QueryType\u0027."",""locations"":[{""line"":1,""column"":3}],""extensions"":{""code"":""ACCESS_DENIED"",""codes"":[""ACCESS_DENIED""]}}]}");
752
752
}
753
753
754
+
[Theory]
755
+
[InlineData("Role1",false,false)]// User with Role1, child requires Role2 - should fail at child level
756
+
[InlineData("Role2",false,false)]// User with Role2, query requires Role1 - should fail at query level
757
+
[InlineData("Role1,Role2",false,true)]// User with both roles - should pass
758
+
[InlineData(null,false,false)]// Unauthenticated user - should fail at query level
759
+
[InlineData("Role1",true,false)]// User with Role1, child requires Role2 and is anonymous - should fail
760
+
[InlineData("Role2",true,true)]// User with Role2, child requires Role2 and is anonymous - should pass
761
+
[InlineData("Role1,Role2",true,true)]// User with both roles, child is anonymous - should pass
762
+
[InlineData(null,true,false)]// Unauthenticated user, child is anonymous - should fail as Role2 is missing
0 commit comments