Base solution for your next web application
Open Closed

Ignore the RequiresFeature for host user. #8332


User avatar
0
razkhan78 created

Hi We are using AspNetZero (Paid) Product version --> 4.0 Product type --> MVC Product framework type --> .net core

we are using the RequiresFeature. But when Host user is hitting the URL it will give the FeatureChecker Exception "FeatureChecker can not get a feature value by name. TenantId is not set in the IAbpSession!".

How to ignore the RequiresFeature for host user?


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

    From https://aspnetboilerplate.com/Pages/Documents/Feature-Management#ignore-feature-check-for-host-users:

    If you enabled Multi-Tenancy, then you can also ignore feature check for host users by configuring it in PreInitialize method of our module as shown below:

    Configuration.MultiTenancy.IgnoreFeatureCheckForHostUsers = true;
    
  • User Avatar
    0
    razkhan78 created

    @aaron We didn't found IgnoreFeatureCheckForHostUsers in our code.

    See attached and our aspnetzero project is haveing this configuration:

    Product version --> 4.0 Product type --> MVC Product framework type --> .net core

    Please revert on this asap.

  • User Avatar
    0
    aaron created
    Support Team

    Which version of ABP are you on?

    IgnoreFeatureCheckForHostUsers was introduced in ABP v4.2.0.

  • User Avatar
    0
    razkhan78 created

    @aaron Is there anyother way we can handle in our existing version. By implmenting or overriding some feature related class or any otherway?

  • User Avatar
    0
    aaron created
    Support Team

    You can override FeatureChecker.IsEnabled (and its async counterpart) and then replace IFeatureChecker.

  • User Avatar
    0
    ismcagdas created
    Support Team

    This issue is closed because of no recent activity. Please create a new issue if you are still having this problem.