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 v8.2.0-preview Updated on March 25, 2024, 15:11