Open Closed

How to disable some features of the Account Module??? #3033


0
dienntt[email protected] created

I'm using the Commercial version. I want to disable some features: Account Linking, Two Factor Authentication, User Profile Picture. Help me!!

  • ABP Framework version: v4.4.1
  • UI type: MVC
  • DB provider: EF Core

1 Answer(s)
  • 0
    liangshiwei created
    Support Team

    Hi,

    Account Linking and User Profile Picture

    public class MyMenuContributor : IMenuContributor
    {
        public async Task ConfigureMenuAsync(MenuConfigurationContext context)
        {
            if (context.Menu.Name == StandardMenus.Main)
            {
                context.Menu.TryRemoveMenuItem("Account.LinkedAccounts");
                context.Menu.TryRemoveMenuItem("Account.Manage");
            }
        }
    }
    

    Two Factor Authentication

    public class MyFeatureDefinitionProvider : FeatureDefinitionProvider
    {
        public override void Define(IFeatureDefinitionContext context)
        {
            var group = context.GetGroupOrNull(IdentityProFeature.GroupName);
    
            var twoFeature = group.Features.First(x => x.Name == IdentityProFeature.TwoFactor);
            twoFeature.DefaultValue = "false";
            twoFeature.IsAvailableToHost = false;
            twoFeature.IsVisibleToClients = false;
        }
    }