0
sandeep.step2gen@gmail.com created
- ABP Framework version: v7.3.2
- UI Type: Angular
- Database System: EF Core (SQL Server)
- Tiered (for MVC) or Auth Server Separated (for Angular): NO
- Exception message and full stack trace:
System.IO.FileNotFoundException: Could not load file or assembly 'Volo.Abp.PermissionManagement.Domain, Version=7.3.2.0, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified. File name: 'Volo.Abp.PermissionManagement.Domain, Version=7.3.2.0, Culture=neutral, PublicKeyToken=null' at System.Reflection.CustomAttribute._CreateCaObject(RuntimeModule pModule, RuntimeType type, IRuntimeMethodInfo pCtor, Byte** ppBlob, Byte* pEndBlob, Int32* pcNamedArgs) at System.Reflection.CustomAttribute.AddCustomAttributes(ListBuilder
1& attributes, RuntimeModule decoratedModule, Int32 decoratedMetadataToken, RuntimeType attributeFilterType, Boolean mustBeInheritable, ListBuilder1 derivedAttributes) at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeType type, RuntimeType caType, Boolean inherit) at System.Attribute.GetCustomAttributes(MemberInfo element, Boolean inherit) at Volo.Abp.Modularity.AbpModuleHelper.FindDependedModuleTypes(Type moduleType) at Volo.Abp.Modularity.AbpModuleHelper.AddModuleAndDependenciesRecursively(List
1 moduleTypes, Type moduleType, ILogger logger, Int32 depth) at Volo.Abp.Modularity.AbpModuleHelper.AddModuleAndDependenciesRecursively(List1 moduleTypes, Type moduleType, ILogger logger, Int32 depth) at Volo.Abp.Modularity.AbpModuleHelper.AddModuleAndDependenciesRecursively(List
1 moduleTypes, Type moduleType, ILogger logger, Int32 depth) at Volo.Abp.Modularity.AbpModuleHelper.AddModuleAndDependenciesRecursively(List1 moduleTypes, Type moduleType, ILogger logger, Int32 depth) at Volo.Abp.Modularity.AbpModuleHelper.FindAllModuleTypes(Type startupModuleType, ILogger logger) at Volo.Abp.Modularity.ModuleLoader.FillModules(List
1 modules, IServiceCollection services, Type startupModuleType, PlugInSourceList plugInSources) at Volo.Abp.Modularity.ModuleLoader.GetDescriptors(IServiceCollection services, Type startupModuleType, PlugInSourceList plugInSources) at Volo.Abp.Modularity.ModuleLoader.LoadModules(IServiceCollection services, Type startupModuleType, PlugInSourceList plugInSources) at Volo.Abp.AbpApplicationBase.LoadModules(IServiceCollection services, AbpApplicationCreationOptions options) at Volo.Abp.AbpApplicationBase..ctor(Type startupModuleType, IServiceCollection services, Action1 optionsAction) at Volo.Abp.AbpApplicationWithExternalServiceProvider..ctor(Type startupModuleType, IServiceCollection services, Action
1 optionsAction) at Volo.Abp.AbpApplicationFactory.Create(Type startupModuleType, IServiceCollection services, Action1 optionsAction) at Volo.Abp.AbpApplicationFactory.CreateAsync[TStartupModule](IServiceCollection services, Action
1 optionsAction) at Microsoft.Extensions.DependencyInjection.ServiceCollectionApplicationExtensions.AddApplicationAsync[TStartupModule](IServiceCollection services, Action1 optionsAction) at Microsoft.Extensions.DependencyInjection.WebApplicationBuilderExtensions.AddApplicationAsync[TStartupModule](WebApplicationBuilder builder, Action
1 optionsAction) at v3.spathios.Program.Main(String[] args) in C:\Step2gen\Spathios\Backend\aspnetcore\src\v3.spathios.HttpApi.Host\Program.cs:line 38`- Steps to reproduce the issue:
- Add permission module into your solution with this command
abp add-module Volo.PermissionManagement --with-source-code --add-to-solution-file
- and try to run project
5 Answer(s)
-
0
Hi,
This is because the permission module is a basic module and other module dependencies depend on it through package references.
So I don't recommend you to add it.
You can explain your use case and I will try to help you
-
0
I understand your point. Thank you for clarifying I'd like for any updates made to role permissions by the Host Tenant to be reflected across all tenants in the application, updating roles with identical names."
-
0
Hi,
You can override the
PermissionAppService
For example: (no test)
[ExposeServices(typeof(IPermissionAppService))] public class MyPermissionAppService : PermissionAppService { private readonly ITenantRepository _tenantRepository; private readonly IIdentityRoleRepository _identityRoleRepository; private readonly ILookupNormalizer _lookupNormalizer; public MyPermissionAppService( IPermissionManager permissionManager, IPermissionDefinitionManager permissionDefinitionManager, IOptions<PermissionManagementOptions> options, ISimpleStateCheckerManager<PermissionDefinition> simpleStateCheckerManager, ITenantRepository tenantRepository, IIdentityRoleRepository identityRoleRepository, ILookupNormalizer lookupNormalizer) : base(permissionManager, permissionDefinitionManager, options, simpleStateCheckerManager) { _tenantRepository = tenantRepository; _identityRoleRepository = identityRoleRepository; _lookupNormalizer = lookupNormalizer; } public override async Task UpdateAsync(string providerName, string providerKey, UpdatePermissionsDto input) { if(providerName != RolePermissionValueProvider.ProviderName || CurrentTenant.IsAvailable) { await base.UpdateAsync(providerName, providerKey, input); return; } await base.UpdateAsync(providerName, providerKey, input); await UpdateAllTenantRolesAsync(providerName, providerKey, input); } private async Task UpdateAllTenantRolesAsync(string providerName, string providerKey, UpdatePermissionsDto input) { var roleName = (await _identityRoleRepository.GetAsync(Guid.Parse(providerKey))).Name; var tenants = await _tenantRepository.GetListAsync(); foreach(var tenant in tenants) { using(CurrentTenant.Change(tenant.Id)) { var tenantRole = await _identityRoleRepository.FindByNormalizedNameAsync(_lookupNormalizer.NormalizeName(roleName)); if(tenantRole == null) { continue; } await base.UpdateAsync(providerName, tenantRole.Id.ToString(), input); } } } }
-
0
Thanks liangshiwei, Its working btw for roles ABP is saving the role name for the ProviderKey. apart from that all the code is working
-
0
I remember it wrong. I thought it was
Id
, good to hear that it working for you.