Activities of "uyarbtrlp"

  • ABP Framework version: v5.1.1
  • UI type: MVC
  • DB provider: EF Core
  • Tiered (MVC): yes
  • Exception message and stack trace:
  • Steps to reproduce the issue:"

Hello,

We want to publish the event to both Kafka and RabbitMQ at the same time. Are there any examples or suggestions about that?

We have a user which is a master user and responsible for creating tenants when the multitenancy is true. This user is the HOST user. We don't want to grant the tenant specific permissions to this user. If the user has these permissions, it can manage the tenant specific features.

That's why we don't mark the multitenancy side as MultiTenancySides.Both or we don't ignore the multitenancy. We want that our application is runnable whether the multitenancy is false or true.

When the multitenancy side is false, we want to grant tenant specific permissions (like creating a new permission group and mark as MultiTenancySides.Host like the comment above) to this master user. Since there isn't the multitenancy side the HOST user behavior will be changed and the HOST user will have these permissions. So, it can manage the features. We can say that we have two different approaches.

When I disable the multitenancy, I want to grant the permissions which are for the tenant. For example,

var odmsUserInterfacePermission = odmsPermissionGroup.AddPermission(
                name: OdmsPermissions.UI.UIPermission,
                displayName: L("Permission:UI"), // localization string
                multiTenancySide: MultiTenancySides.Tenant, // set multi-tenancy side
                isEnabled: true // by default is activated
            ).RequireFeatures(OdmsFeatures.ApplicationBaseFeature);

As you can see, this permission is only for the tenant. But in our case, we want to grant this permission while seeding the users like in the code below.

private async Task GrantPermissionToRole(string permissionName, string roleName)
        {

            await PermissionManager.SetAsync(permissionName, RolePermissionValueProvider.ProviderName, roleName, true);
        }

In the database, I can see the permission which are marked as MultiTenancySides.Both or MultiTenancySides.Host. After that, the exception is thrown:

The permission named 'Odms.UI' has multitenancy side 'Tenant' which is not compatible with the current multitenancy side 'Host'. See the inner exception for details.
---> System.ApplicationException: The permission named 'Odms.UI' has multitenancy side 'Tenant' which is not compatible with the current multitenancy side 'Host'
   at Volo.Abp.PermissionManagement.PermissionManager.SetAsync(String permissionName, String providerName, String providerKey, Boolean isGranted)
   at Siemens.Abp.Personas.PlatformIdentityDataSeeder.GrantPermissionToRole(String permissionName, String roleName, Nullable`1 tenantId)
   at Siemens.Abp.Personas.PlatformIdentityDataSeeder.SeedModelAdminAsync(String adminUserName, String adminEmail, String adminPassword, Nullable`1 tenantId)
   at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo)
   at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue`1.ProceedAsync()
   at Volo.Abp.Uow.UnitOfWorkInterceptor.InterceptAsync(IAbpMethodInvocation invocation)
   at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed)
   at Siemens.Abp.Personas.PlatformIdentityDataSeedContributor.SeedAsync(DataSeedContext context)
   at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous(IInvocation invocation, IInvocationProceedInfo proceedInfo)
   at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapter.ProceedAsync()
   at Volo.Abp.Uow.UnitOfWorkInterceptor.InterceptAsync(IAbpMethodInvocation invocation)
   at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync(IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed)
   at Volo.Abp.Data.DataSeeder.SeedAsync(DataSeedContext context)
   at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous(IInvocation invocation, IInvocationProceedInfo proceedInfo)
   at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapter.ProceedAsync()
   at Volo.Abp.Uow.UnitOfWorkInterceptor.InterceptAsync(IAbpMethodInvocation invocation)
   at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync(IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed)
   at Siemens.Abp.Personas.AbpPersonasModule.SeedAsync(IServiceScope scope, AbpPersonasModuleOptions options, Nullable`1 forcedTenantId)
   at Siemens.Abp.Personas.AbpPersonasModule.<>c__DisplayClass1_0.<<OnApplicationInitialization>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at Nito.AsyncEx.Synchronous.TaskExtensions.WaitAndUnwrapException(Task task)
   at Nito.AsyncEx.AsyncContext.<>c__DisplayClass15_0.<Run>b__0(Task t)
   at System.Threading.Tasks.ContinuationTaskFromTask.InnerInvoke()
   at System.Threading.Tasks.Task.<>c.<.cctor>b__272_0(Object obj)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
--- End of stack trace from previous location ---
   at Nito.AsyncEx.Synchronous.TaskExtensions.WaitAndUnwrapException(Task task)
   at Nito.AsyncEx.AsyncContext.Run(Func`1 action)
   at Volo.Abp.Threading.AsyncHelper.RunSync(Func`1 action)
   at Siemens.Abp.Personas.AbpPersonasModule.OnApplicationInitialization(ApplicationInitializationContext context)
   at Volo.Abp.Modularity.AbpModule.OnApplicationInitializationAsync(ApplicationInitializationContext context)
   at Volo.Abp.Modularity.OnApplicationInitializationModuleLifecycleContributor.InitializeAsync(ApplicationInitializationContext context, IAbpModule module)
   at Volo.Abp.Modularity.ModuleManager.InitializeModulesAsync(ApplicationInitializationContext context)
   --- End of inner exception stack trace ---
   at Volo.Abp.Modularity.ModuleManager.InitializeModulesAsync(ApplicationInitializationContext context)
   at Volo.Abp.AbpApplicationBase.InitializeModulesAsync()
   at Volo.Abp.AbpApplicationWithExternalServiceProvider.InitializeAsync(IServiceProvider serviceProvider)
   at Microsoft.AspNetCore.Builder.AbpApplicationBuilderExtensions.InitializeApplicationAsync(IApplicationBuilder app)
   at Siemens.Odms.Program.Main(String[] args) in C:\Users\z0048kcm\siemens.odms\host\Siemens.Odms.IdentityServer\Program.cs:line 40

We want to use the tenant permission when the multitenancy is false. It seems we need to define new permission group and put our logic when the multitenancy side is false because it is not handled. I think we need such a logic in the PermissionDefinitionProvider

if(multitenancy == true) {

var odmsUserInterfacePermission = odmsPermissionGroup.AddPermission(
                name: OdmsPermissions.UI.UIPermission,
                displayName: L("Permission:UI"), // localization string
                multiTenancySide: **MultiTenancySides.Tenant**, // set multi-tenancy side is true
                isEnabled: true // by default is activated
            ).RequireFeatures(OdmsFeatures.ApplicationBaseFeature);

}
else
{

var odmsUserInterfacePermission = odmsPermissionGroup.AddPermission(
                name: OdmsPermissions.UI.UIPermission,
                displayName: L("Permission:UI"), // localization string
                multiTenancySide: **MultiTenancySides.Host**, // set multi-tenancy side is false
                isEnabled: true // by default is activated
            ).RequireFeatures(OdmsFeatures.ApplicationBaseFeature);

}
  • ABP Framework version: v5.1.1
  • UI type: MVC
  • DB provider: EF Core
  • Module Template (MVC): yes
  • Separated Deployment & Databases Scenario (MVC): yes
  • Steps to reproduce the issue:"

Hello Abp,

We are currently using the module template with UI. We want to use the module template, when the multitenancy is true or false. Our module should be runnable according to the multitenancy option. We want to integrate the both way.

In PermissionDefinitionProvider, we set our permissions like in the documentation. We have the permissions that are only for the tenant and also for the both side. While we are running the module with multitenancy = false, tenant side permissions is not granted. But we want to use these permissions because we don't need the multitenancy. This is the case.

Here is my question: Does the Abp handle this situation or should we put our logic into the PermissionDefinitionProvider (like if the multitenancy is false, we define new permission groups which are only MultiTenancySides.Host. But in this way, we need to duplicate the permissions.)

Thanks.

I have the same issue in other versions such as 5.1, 5.0

I am using the LocalDistributedEventBus which is default.

Yes, of course. When I configure and map the object which is created by me like document you sent, I can subscribe the event. Like I mentioned, I couldn't subscribe events related with Identity such as creating a new user, creating a new role. Also, I can subscribe these events on Single (Unified) Application Scenario, but not on Separated Deployment & Databases Scenario. I realized above code block, somehow, didn't represent the handler which I created.

  • ABP Framework version: v5.1.4
  • UI type: MVC
  • DB provider: EF Core
  • Module Template: yes
  • Steps to reproduce the issue:"
  1. I've created the module template by using abp suite.
  2. I've used the Separated Deployment & Databases Scenario. Therefore, I've runned update-db.ps1 script in both HttpApi.Host and IdentityServer projects.
  3. I've runned the solution.
  4. I've created the TestUserHandler class under TestApplication.Domain and subscribe the UserEto.
  5. I've given a reference Volo.Abp.Users.Domain for using UserEto.
   public class TestUserHandler : IDistributedEventHandler<EntityCreatedEto<UserEto>>, ITransientDependency
    {

        private readonly ICurrentTenant _currentTenant;


        private readonly ILogger<TestUserHandler> _logger;


        public TestUserHandler( ICurrentTenant currentTenant, ILogger<TestUserHandler> logger)
        {
            _currentTenant = currentTenant;
            _logger = logger;
        }
        public virtual async Task HandleEventAsync(EntityCreatedEto<UserEto> eventData)
        {

            
        }
    }
  1. I couldn't subscribe the event while adding a new user.
  2. When I use the same structure on Single (Unified) Application Scenario, I can subscribe the event and see the data of new user. It is same for EntityUpdatedEto<UserEto>
  3. Do I need to add external packages or codes for getting the event data or is it a kind of bug? How can I resolve this?

Thanks, it works.

ABP Framework version: v5.1.1 UI type: MVC DB provider: EF Core Module Template: yes Steps to reproduce the issue:"

  1. I've created the module template by using abp cli ->abp new Acme.IssueManagement -t module-pro -v 5.1.1
  2. I've used the Separated Deployment & Databases Scenario. Therefore, I've runned update-db.ps1 script in both HttpApi.Host and IdentityServer projects.
  3. I've runned the solution.
  4. When I click one of the default modules page such as Identity Management -> Users from web ui, I face this error:
  5. Users endpoint works properly on Swagger UI. Exception message and stack trace: These are the logs from Web.Host 2022-03-14 11:13:55.979 +03:00 [INF] Request starting HTTP/2 GET https://localhost:44369/Identity/Users - - 2022-03-14 11:13:55.981 +03:00 [INF] Start processing HTTP request GET "https://localhost:44356/api/abp/application-configuration?api-version=1.0" 2022-03-14 11:13:55.982 +03:00 [INF] Sending HTTP request GET "https://localhost:44356/api/abp/application-configuration?api-version=1.0" 2022-03-14 11:13:56.069 +03:00 [INF] Received HTTP response headers after 87.0187ms - 200 2022-03-14 11:13:56.069 +03:00 [INF] End processing HTTP request after 87.2745ms - 200 2022-03-14 11:13:56.088 +03:00 [INF] Executing endpoint '/Identity/Users/Index' 2022-03-14 11:13:56.088 +03:00 [INF] Route matched with {page = "/Identity/Users/Index", action = "", controller = "", area = ""}. Executing page /Identity/Users/Index 2022-03-14 11:13:56.088 +03:00 [INF] Skipping the execution of current filter as its not the most effective filter implementing the policy Microsoft.AspNetCore.Mvc.ViewFeatures.IAntiforgeryPolicy 2022-03-14 11:13:56.088 +03:00 [INF] Executing handler method Volo.Abp.Identity.Web.Pages.Identity.Users.IndexModel.OnGetAsync - ModelState is "Valid" 2022-03-14 11:13:56.088 +03:00 [INF] Start processing HTTP request GET "https://localhost:44356/api/identity/users/lookup/roles?api-version=1.0" 2022-03-14 11:13:56.088 +03:00 [INF] Sending HTTP request GET "https://localhost:44356/api/identity/users/lookup/roles?api-version=1.0" 2022-03-14 11:13:56.123 +03:00 [INF] Received HTTP response headers after 34.93ms - 200 2022-03-14 11:13:56.124 +03:00 [INF] End processing HTTP request after 35.0652ms - 200 2022-03-14 11:13:56.125 +03:00 [INF] Start processing HTTP request GET "https://localhost:44356/api/identity/users/lookup/organization-units?api-version=1.0" 2022-03-14 11:13:56.125 +03:00 [INF] Sending HTTP request GET "https://localhost:44356/api/identity/users/lookup/organization-units?api-version=1.0" 2022-03-14 11:13:56.144 +03:00 [INF] Received HTTP response headers after 18.891ms - 200 2022-03-14 11:13:56.144 +03:00 [INF] End processing HTTP request after 19.0409ms - 200 2022-03-14 11:13:56.145 +03:00 [INF] Executed handler method OnGetAsync, returned result Microsoft.AspNetCore.Mvc.RazorPages.PageResult. 2022-03-14 11:13:56.165 +03:00 [DBG] Added bundle 'Lepton.Global' to the page in 2.16 ms. 2022-03-14 11:13:56.167 +03:00 [DBG] Added bundle 'Volo.Abp.Identity.Web.Pages.Identity.Users.IndexModel' to the page in 1.73 ms. 2022-03-14 11:13:56.180 +03:00 [DBG] Added bundle 'Lepton.Global' to the page in 4.01 ms. 2022-03-14 11:13:56.182 +03:00 [DBG] Added bundle 'Volo.Abp.Identity.Web.Pages.Identity.Users.IndexModel' to the page in 1.08 ms. 2022-03-14 11:13:56.190 +03:00 [INF] Executed page /Identity/Users/Index in 101.7788ms 2022-03-14 11:13:56.190 +03:00 [INF] Executed endpoint '/Identity/Users/Index' 2022-03-14 11:13:56.193 +03:00 [INF] Request finished HTTP/2 GET https://localhost:44369/Identity/Users - - - 200 - text/html;+charset=utf-8 213.7965ms

How can I resolve this?

Showing 41 to 50 of 72 entries
Made with ❤️ on ABP v8.2.0-preview Updated on March 25, 2024, 15:11