Base solution for your next web application

Activities of "daws"

Hi there, since i have no time to produce a sample project, i will continue with my workaround.

thanks

hi @ismcagdas,

Abp version is 6.3.1 (aspnetzero 8.8). We plan to migrate to anz 13.3 in september.

Seems to work fine. Thank you very much !

Ok thank you. Your 2nd solution works...except for the language.

How can I also set the language in the session ?

So in the frontend I'm replacing this code :

        abp.utils.setCookieValue(
            'Abp.Localization.CultureName',
            language.name,
            new Date(new Date().getTime() + 5 * 365 * 86400000), // 5 year
            abp.appPath
        );

by this :

localStorage.setItem('Abp.Localization.CultureName', language);

But then, I can't find where the language is retrieved. I tried to change request headers in AppPreBootstrap but it didn't work.

Shall I change the backend culture provider ? If yes how so ?

modifing the httpcontext or overriding the abpsession was too much complex for my use case.

I have found the solution, simply use

using (_unitOfWorkManager.Current.DisableAuditing(new string[]{ AbpAuditFields.CreationUserId}))

Thanks for the hint but I am still stuck.

If I override GetAuditUserId, of course I can force it to return null but I want to get a null value only in a specific call, not for all methods. In all other method (except the one listed in my other post), it is important to keep the UserId filled in.

thus, I wanted to use this function https://github.com/aspnetboilerplate/aspnetboilerplate/blob/dev/src/Abp/Runtime/Session/AbpSessionBase.cs#L40 which is supposed to take nullable userId but which does not work.

I halso have another possibility which is to give a boolean parameter to the dbcontext TestDbContext : AbpZeroDbContext once the program is started and, depending of this boolean parameter, returning null in GetAuditUserId(). But I can not find a way to give a parameter to the dbcontext when it is created.

do you have any more tips ?

thanks

        protected override long? GetAuditUserId()
        {
            if (AbpSession.UserId.HasValue &&
                CurrentUnitOfWorkProvider != null &&
                CurrentUnitOfWorkProvider.Current != null &&
                CurrentUnitOfWorkProvider.Current.GetTenantId() == AbpSession.TenantId)
            {
                return AbpSession.UserId;
            }

            return null;
        }

Our mistake. When migrating, we omitted the change which adds the [HttpPost] decorator on the GetRoles method in the RoleAppService.

Without it, it seems that the method is recognized as a GET method and therefore has its input parameters split.

Thanks for the support.

I don't think it has anything to do with the service-proxies generation.

As you can see in my request, the swagger endpoint generated in the backend (https://localhost:44301/swagger/v1/swagger.json) already splits the Input class into its properties.

There must be some swagger configuration parameter enabling the split in the backend but I can't seem to find it...

Hi @ismcagdas

We ended up creating a separate table and not using an abpsetting for this. It's faster, it's useful for other use cases and it works fine. Thank you anyway for your reply !

Answer

Hello, thanks for your answer.

My use case is as follows :

Usually, each of our customers manages a single site (= tenant).

However, we have one of our customers who manages two sites (two different tenants). This customer has several users and most of them should be able to connect to both tenants with the same username, role and permissions

Showing 1 to 10 of 83 entries