In General: use standard dev recipes for this.

Also

  1. Make sure you test for the feature to be enabled - usually code like: 

    using Feats = ToSic.Eav.Configuration.Features;

    var feats = new[] {FeatureIds.PublicForms};
    if (!Feats.Enabled(feats))
    throw new Exception($"low-permission users may not access this - {Feats.MsgMissingSome(feats)}");

  2. Make sure that when it's not, and the user should know, that the message includes the DisabledMsg(featureIds) part.