Hi
I want to remove two auth and picture tabs from the manage profile page so how can I delete or hide please let me know.
- ABP Framework version: v4.4.3
- UI type: Blazor
- DB provider: EF Core
- Tiered (MVC) or Identity Server Separated (Angular): no
- Exception message and stack trace:
- Steps to reproduce the issue:"
Thanks,
9 Answer(s)
-
0
-
0
IProfileManagementPageContributor
do I need to use this code?
-
0
No. This is build-in code, You need to remove the item from the context.
-
0
-
0
You add a MyProfileManagementPageContributorservice and remove two auth and pictures from the context.
-
0
You add a MyProfileManagementPageContributorservice and remove two auth and pictures from the context.
public class MyAccountProfileManagementPageContributor : IProfileManagementPageContributor { public async Task ConfigureAsync(ProfileManagementPageCreationContext context) { var l = context.ServiceProvider.GetRequiredService<IStringLocalizer<AccountResource>>();
if (await IsPasswordChangeEnabled(context)) { context.Groups.Add( new ProfileManagementPageGroup( "Volo-Abp-Account-Password", l["ProfileTab:Password"], typeof(AccountProfilePasswordManagementGroupViewComponent) ) ); } context.Groups.Add( new ProfileManagementPageGroup( "Volo-Abp-Account-PersonalInfo", l["ProfileTab:PersonalInfo"], typeof(AccountProfilePersonalInfoManagementGroupViewComponent) ) ); } protected virtual async Task<bool> IsPasswordChangeEnabled(ProfileManagementPageCreationContext context) { var userManager = context.ServiceProvider.GetRequiredService<IdentityUserManager>(); var currentUser = context.ServiceProvider.GetRequiredService<ICurrentUser>(); var user = await userManager.GetByIdAsync(currentUser.GetId()); return !user.IsExternal; } }
do I need to call this anywhere?
-
0
Configure<ProfileManagementPageOptions>(options => { options.Contributors.Add(new MyAccountProfileManagementPageContributor()); }); public async Task ConfigureAsync(ProfileManagementPageCreationContext context) { context.Groups.Remove.. }
-
0
-
0
context.Groups.RemoveAll(x => x.Id == "Volo-Abp-Account-Picture" || x.Id == "Volo-Abp-Account-TwoFactor");