Activités de "uyarbtrlp"

So, it is not possible to use like that. According to that, I have two questions:

  • Do you have any plan to convert it to a callback method?
  • Should I create separate buttons for that? What is your suggestion?

Thanks, it works now.

The example is not the modal example. It is a whole page request. I know that I can use it for the page. I was trying to ask you about the modal that is created by abp.modalManager like the below:

This is where we open the modal by using action button on datatable.

This is the razor page where we define our modal and its items

This is the cshtml.cs file and OnGetAsync method that we have.

Underlined code has thrown the exception and we want to show that exception on the UI. This is the modal which been created by using abp.modalManager. There are such a functionality for the OnPostAsync method. Whenever I get the exception in OnPostAsync from the app service that I marked, I am able to see it as a error modal or something like that.

But for now, the modal cannot be created due to the exception and we want to show that exception to the user. It seems that showing the exception on the UI is not handled like in OnPostAsync. Do you have any suggestion about that issue when using the modal? We need such a showing mechanism to the user.

Yeah, I've tried to create the page alert for the modal. You've mentioned that in your documentation: Page Alert system was designed to be used in a regular full page request. It is not for AJAX/partial requests. The alerts are rendered in the page layout, so a full page refresh is needed. There is no full page request for our situation. I just hit the button for opening the modal, and I can't see the modal due to the exception in OnGetAsync method. Actually, you've touched the point that I wanted to ask. We have a problem in our system and we want to show the error message which is thrown by the backend side. If the user called the API for that functionality, he would see the error message on Swagger or on Postman. It is not same for the UI. I think it should be like that for the UI. Are there any functionality for that or (if there is not) will you integrate that functionality or do you have any suggestions about how to do it?

@Buckoge,

Thanks for the suggestion. By redirecting to the page, you create a new page for that. What I need is the alert message or something like that. It should be similar to the OnPostAsync method. When you get the exception in application service in OnPostAsync method, you see the error message on the UI. I need such a functionality for OnGetAsync, too.

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);

}

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.

Affichage de 21 à 30 sur 44 entrées
Made with ❤️ on ABP v8.2.0-preview Updated on mars 25, 2024, 15:11