abp icon indicating copy to clipboard operation
abp copied to clipboard

Extend feature management to the User level

Open szilardd opened this issue 1 year ago • 2 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Is your feature request related to a problem? Please describe the problem.

The Feature management system allows defining feature values for Editions and Tenants. I would like to do the same on the User level. Based on my research this is not possible currently, there is no UserFeatureValueProvider, only these:

Would the Abp architecture support this? I think that the database structure should because the AbpFeatureValues table has a ProviderName column that should support the user level (ProviderName = 'U')

Describe the solution you'd like

Create a new feature value provider: UserFeatureValueProvider to allow defining and checking feature values on User level.

RequiresFeature attribute and IFeatureChecker should check this provider.

Is this possible from an architectural point of view, do you have any plans to implement it in the future? Or could you provide some guidance on how to implement it?

The documentation has a bit of guidance on how to add a custom provider: https://docs.abp.io/en/abp/latest/Modules/Feature-Management#feature-management-providers

Thanks

Additional context

No response

szilardd avatar Jan 24 '24 09:01 szilardd

hi

The current design features only exist at the tenant or edition level.

Of course, as you said, you can customize FeatureValueProvider to implement your business.

Add your FeatureValueProvider after TenantFeatureValueProvider.

https://github.com/abpframework/abp/blob/dev/framework/src/Volo.Abp.Features/Volo/Abp/Features/AbpFeaturesModule.cs#L34 https://github.com/abpframework/abp/blob/dev/modules/feature-management/src/Volo.Abp.FeatureManagement.Domain/Volo/Abp/FeatureManagement/AbpFeatureManagementDomainModule.cs#L32

maliming avatar Jan 24 '24 12:01 maliming