Hi I have some predefined roles and seed them during migration. I want to add permissions to those roles during seed process. Docs recommend to define permission providers in Application.Contracts project, but PermissionDefenitionProvider are reflected while starting web project. I also moved them to Domain.Shared project, but not succeed. I will be glad if you give a good and standard solution for this scenario.
3 Answer(s)
-
1
Hi,
I have some predefined roles and seed them during migration. Docs recommend to define permission providers in Application.Contracts project
The
.DBMigrator
project reference to.Application.Contracts
.So this is the standard solution, You can refer to
PermissionDataSeedContributor
to create your ownContributor
: https://github.com/abpframework/abp/blob/e3e1779de6df5d26f01cdc8e99ac9cbcb3d24d3c/modules/permission-management/src/Volo.Abp.PermissionManagement.Domain/Volo/Abp/PermissionManagement/PermissionDataSeedContributor.cs#L26 -
0
Thanks, This solved my problem What about edition features seed contributor? Do you have an example?
-
0
Hi,
I'm sorry that we don't have such example.
You can use the
IFeatureDefinitionManager
to get all feature definitions and useIFeatureManager
to set feature.