Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

OR check with AbpAuthorize attribute #4562


User avatar
0
ajayak created

Hi,

I want to allow an AppService either to be consumed Permission1 OR permission2. How can I do so using

[AbpAuthorize]

?


2 Answer(s)
  • User Avatar
    0
    aaron created
    Support Team

    Refer to these test cases:

    // Should be called. Permission3 is not granted but Permission1 is granted.
    [AbpAuthorize("Permission1", "Permission3")]
    public virtual void MethodWithPermission1AndPermission3()
    {
    }
    
    // Should not be called. Permission3 is not granted and it required all permissions must be granted
    [AbpAuthorize("Permission1", "Permission3", RequireAllPermissions = true)]
    public virtual void MethodWithPermission1AndPermission3WithRequireAll()
    {
    }
    
  • User Avatar
    0
    ajayak created

    Thanks, @aaron :)