Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Extension Property Policy feature. #20281

Merged
merged 3 commits into from
Jul 30, 2024
Merged

Add Extension Property Policy feature. #20281

merged 3 commits into from
Jul 30, 2024

Conversation

maliming
Copy link
Member

@maliming maliming commented Jul 25, 2024

Resolves #20245

Using 64126e8 to test.

Breaking change:
The method signature of framework/src/Volo.Abp.BlazoriseUI/AbpCrudPageBase.cs has been changed.

- IEnumerable<TableColumn> GetExtensionTableColumns(string moduleName, string entityType) 
+ Task<List<TableColumn>> GetExtensionTableColumnsAsync(string moduleName, string entityType)
ObjectExtensionManager.Instance.Modules()
.ConfigureIdentity(identity =>
{
    identity.ConfigureUser(user =>
    {
        user.AddOrUpdateProperty<string>( //property type: string
            "SocialSecurityNumber", //property name
            property =>
            {
                //validation rules
                property.Attributes.Add(new RequiredAttribute());
                property.Attributes.Add(new StringLengthAttribute(64) {MinimumLength = 4});

                property.Policy.GlobalFeatures = new ExtensionPropertyGlobalFeaturePolicyConfiguration()
                {
                     Features = new[] {"GlobalFeatureName1", "GlobalFeatureName2"},
                     RequiresAll = true
                };

                property.Policy.Features = new ExtensionPropertyFeaturePolicyConfiguration()
                {
                    Features = new[] {"FeatureName1", "FeatureName2"},
                    RequiresAll = false
                };

                property.Policy.Permissions = new ExtensionPropertyPermissionPolicyConfiguration()
                {
                    PermissionNames = new[] {"AbpTenantManagement.Tenants.Update", "AbpTenantManagement.Tenants.Delete"},
                    RequiresAll = true
                };
            }
        );
    });
});

@EngincanV EngincanV merged commit 41df9a8 into dev Jul 30, 2024
2 of 3 checks passed
@EngincanV EngincanV deleted the ExtensionPropertyPolicy branch July 30, 2024 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a condition to hidden the Extended property
2 participants