Starts in:
2 DAYS
23 HRS
13 MIN
7 SEC
Starts in:
2 D
23 H
13 M
7 S
Open Closed

[Question] How to bypass permission check in some method in AppService for a Commercial module #1054


User avatar
0
yinchang created
  • ABP Framework version: 4.2.2
  • UI type: don't care
  • DB provider: don't care
  • Tiered (MVC) or Identity Server Separated (Angular): don't care

HI: I have a question: When I use FileManagement module, for execute DownloadAsync method in FileDescriptorAppService it need FileManagement.FileDescriptor permission, but I want to let it can be executed without any permission,everyone can use it to download file, I had already read doc about overriding-a-permission-by-a-custom-policy but i don't know how to ignore exist policy for a appservice.

Can you tell me how to do? thank you.


2 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    You can create a subclass to replace FileDescriptorAppService. And overide DownloadAsync method to use AllowAnonymous attribute.

    https://docs.abp.io/en/abp/latest/Customizing-Application-Modules-Overriding-Services

  • User Avatar
    0
    yinchang created

    hi

    You can create a subclass to replace FileDescriptorAppService. And overide DownloadAsync method to use AllowAnonymous attribute.

    https://docs.abp.io/en/abp/latest/Customizing-Application-Modules-Overriding-Services

    Hi: Thank you,It's work

Made with ❤️ on ABP v9.1.0-preview. Updated on November 20, 2024, 13:06