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
@@ -115,12 +126,39 @@ public partial class {config.PublicAPIController}Controller
115
126
[Route(""""""{config.PublicAPIRoute}"""""")]
116
127
public async Task<IActionResult> {config.OperationName}({apiParamDeclWithoutAuthContext})
117
128
{{
129
+
130
+
[RequiredPermissions]
131
+
118
132
var result = await {(config.UseManagementAPI?"_mgmtAPI":"_client")}.{config.OperationName}({apiParamCall.Replace("authContext","CurrentAuthContext")});
119
133
return new OkObjectResult(result);
120
134
}}
121
135
}}
122
-
}}
123
-
",Encoding.UTF8));
136
+
}};
137
+
";
138
+
139
+
if(config.RequiredPermissions.Any())
140
+
{
141
+
varfragment="";
142
+
foreach(varperminconfig.RequiredPermissions)
143
+
{
144
+
fragment+=$@"
145
+
if (!await IsAuthorized(_client, ""{perm.ResourceType}"" , ""{perm.Action}""))
0 commit comments