0
admin@SYNTAQ created
Hi,
I have added custom authorization policies to the startup.cs. They work for the MVC controllers but not the API controllers. Where SHould I configure these so that they work for both?
Ver 8.1 Angular .Net Core
services.AddAuthorization(options =>
{
options.AddPolicy("ViewById", policy => policy.Requirements.Add(new SyntaqAuthorizationRequirement("View", "Id")));
options.AddPolicy("EditById", policy => policy.Requirements.Add(new SyntaqAuthorizationRequirement("Edit", "Id")));
options.AddPolicy("DeleteById", policy => policy.Requirements.Add(new SyntaqAuthorizationRequirement("Delete", "Id")));
options.AddPolicy("ViewByOriginalId", policy => policy.Requirements.Add(new SyntaqAuthorizationRequirement("View", "IdOriginal")));
options.AddPolicy("EditByOriginalId", policy => policy.Requirements.Add(new SyntaqAuthorizationRequirement("Edit", "IdOriginal")));
options.AddPolicy("DeleteByOriginalId", policy => policy.Requirements.Add(new SyntaqAuthorizationRequirement("Delete", "IdOriginal")));
});
Thanks
Cheers
4 Answer(s)
-
0
They work for the MVC controllers but not the API controllers.
Do you mean the dynamic api of the application service layer?
-
0
Yes.
-
0
hi admin@syntaq
The abp framework does not currently support policy authorization. It has its own authorization design.
https://aspnetboilerplate.com/Pages/Documents/Authorization
-
0
This issue is closed because of no recent activity. Please create a new issue if you are still having this problem.