0
sukhdeep.dhillon created
- ABP Framework version: v8.2.1
- UI Type: Angular
- Database System: EF Core (SQL Server)
in Abp, is there any way to check multiple permission with Authorization attribute as OR operator.
[Authorization(permission1, permission2, permission3)] public Task CreateAsync(){
}
1 Answer(s)
-
0
Hi,
You can try this:
Configure<AuthorizationOptions>(options => { options.AddPolicy("TestPermission1_And_TestPermission2", policy => { policy.Requirements.Add(new PermissionsRequirement(["TestPermission1", "TestPermission2"], requiresAll: true)); }); options.AddPolicy("TestPermission1_Or_TestPermission2", policy => { policy.Requirements.Add(new PermissionsRequirement(new []{"TestPermission1", "TestPermission2"}, requiresAll: false)); }); });
[Authorize("TestPermission1_And_TestPermission2")] ..... [Authorize("TestPermission1_Or_TestPermission2")]