Open Closed

Disallow user to edit extra properties #6603


User avatar
0
ninomartini created
  • ABP Framework version: v8.0.2
  • UI Type: Angular
  • Database System: EF Core (SQL Server)
  • Tiered (for MVC) or Auth Server Separated (for Angular): Auth Server Separated (for Angular)

Hello,

I defined an ENUM as an extra property for the user entity as follows.

OneTimeRunner.Run(() =>
{
    ObjectExtensionManager.Instance.Modules()
        .ConfigureIdentity(identity =>
        {
            identity.ConfigureUser(user =>
            {
                user.AddOrUpdateProperty<UserType>("UserType", property =>
                {
                    property.DisplayName = LocalizableString.Create<RxPortalResource>("::UserType");
                    property.Attributes.Add(new RequiredAttribute());
                    property.Configuration[IdentityModuleExtensionConsts.ConfigurationNames.AllowUserToEdit] = false;
                });
            });
        });
});

I want this extra property visible on the user administration user table and dialog box but not visible from the user’s personal information section. However, I am seeing this property in the user’s personal information section.

Is IdentityModuleExtensionConsts.ConfigurationNames.AllowUserToEdit only supported for Blazor? How would I accomplish this in Angular?


5 Answer(s)
  • User Avatar
    0
    Anjali_Musmade created
    Support Team Support Team Member

    Hi,

    Can you check this link https://support.abp.io/QA/Questions/3466/Angular-show-ExtraProperties-on-Registration-and-Profile-pages

    Thnak you.

  • User Avatar
    0
    ninomartini created

    Thank you for your response. I apologize if I was not clear.

    1. I want the extra property to appear on the administration user edit dialog. This is working.
    2. I want the extra property to appear on the user table as an additional column. This is working.
    3. I don't want the extra property to appear under the user's personal information section. The extra property appears under the user's personal information section even with AllowUserToEdit set to false.

    The following link makes it sound like this will only work in MVC/Blazor: https://github.com/abpframework/abp/issues/13999

    The link you referenced may be outdated because it states the extra property is not supported to show up on the user's personal information section. The link goes on to reference another outdated link.

    Would you confirm if this is an MVC/Blazor-only feature? If yes, will Angular support this feature soon? If Angular does support this feature today, please direct me on how to hide the extra property on the user's personal information section. If I need to replace the entire user personal information section, please direct me to a current resource that will work for v8.0.2.

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    Angular UI does not support it, we plan to implement it in 8.2

  • User Avatar
    0
    ninomartini created

    Thank you.

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    : )

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