Open Closed

RequiresFeature not working on module #3693


User avatar
0
maksym created

Check the docs before asking a question: https://docs.abp.io/en/commercial/latest/ Check the samples, to see the basic tasks: https://docs.abp.io/en/commercial/latest/samples/index The exact solution to your question may have been answered before, please use the search on the homepage.

If you're creating a bug/problem report, please include followings:

  • ABP Framework version: v5.3.0
  • UI type: Blazor
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes
  • Exception message and stack trace: 401
  • Steps to reproduce the issue:"

We created a Module using ABP Suite and added the Feature support as explained in the documentation, but when using the RequiresFeature attribute, it doesn't work when the feature is set to "True".

I see the feature when editing features of an edition:

And in the database:

But when adding the RequiresFeature attribute to either a class or a method:

Always throws an error stating that the feature is not enabled. This is the error I copied from Audit Logging:

These are the Settings strings consts:


8 Answer(s)
  • User Avatar
    0
    EngincanV created
    Support Team .NET Developer

    Hi @maksym, I'll try to reproduce the problem and write you back asap.

  • User Avatar
    0
    maksym created

    reopening

  • User Avatar
    0
    EngincanV created
    Support Team .NET Developer

    reopening

    Thanks @maksym, our support bot closed it sorry for that. I'll try to reproduce your problem and write you back within the day.

  • User Avatar
    0
    maksym created

    Hi, were you able to reproduce the issue?

  • User Avatar
    0
    EngincanV created
    Support Team .NET Developer

    But when adding the RequiresFeature attribute to either a class or a method:

    Hi, can you make your methods as virtual? It's required for intercepting.

  • User Avatar
    0
    maksym created

    I've added virtual and async to the methods but the results are still the same.

    As mentioned previously, the issue isn't in the feature management system itself not working, it's the fact that the feature which is set correctly in the database to "true"

    Is still being read as "false" in abp via the feature checker

  • User Avatar
    0
    EngincanV created
    Support Team .NET Developer

    Hi again, sorry I could not reproduce the problem that you are facing. If it's possible can you send your project to me via email (to engin.veske@volosoft.com)?

  • User Avatar
    0
    maksym created

    Hi,

    after fumbling around with this feature management module, I found out that it was because we were changing the values via the "Editions" tab, whereas we had to change them in Tenants and use the "Manage Host Features" button.

    As we didn't enable multitenancy, nor do we use it, it was rather confusing to know what to look for.

    This ticket can be marked as resolved.

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