Base solution for your next web application
Open Closed

ABPAUTHORIZE AUTOMATIC FOR SERVICES #3731


User avatar
0
Hasan created

Hello Team

Is there any way to set all the ApplicationServices as AbpAuthorizr without mention in each method ?

Thanks in advance

Markdown is supported
Copy & paste or drag & drop images (max 30 MB per image)

3 Answer(s)
  • User Avatar
    0
    alirizaadiyahsi created

    Hi,

    If I understand, you can add AbpAuthorize attribute to AppService class, then all methods affected. For example:

    [AbpAuthorize()]
    public class SomeAppService: AbpZeroTemplateAppServiceBase, ISomeAppService
    {
        ...
    
    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • User Avatar
    0
    Hasan created

    How to set for all the Services at one place ?

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @Hasan,

    Adding [AbpAuthorize] to [*AppServiceBase] class might work but I'm not sure about this. If it does not work, you need to add this attribute to every service you want to authorize.

    Thanks.

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)