We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6f2394c commit dc29fe7Copy full SHA for dc29fe7
SharedLibrary/Auth/PermissionHandler.cs
@@ -43,9 +43,13 @@ protected override async Task HandleRequirementAsync(
43
44
if (categories is null) return;
45
46
- bool IsAllowed = categories.Any( c => c.Modules.Any( m => m.Area == area && m.Controller == controller && m.Action == action));
47
-
48
+ bool IsAllowed = false;
+ if (requirement.Permission == "Web")
+ IsAllowed = categories.Any( c => c.Modules.Any( m => m.Area == area && m.Controller == controller && m.Action == action && m.Type == "WebApp"));
49
+ else if (requirement.Permission == "Api")
50
+ IsAllowed = categories.Any(c => c.Modules.Any(m => m.Controller == controller && m.Action == action && m.Type == "Api"));
51
+
52
53
if (IsAllowed)
54
context.Succeed(requirement);
55
}
0 commit comments