Base solution for your next web application

Activities of "geertveenstra"

Hi,

I have some users that can create other users (and assign roles to them), but I want to prevent those users to assign the Admin role to others (or themselves). Is this possible ? If not, maybe some hints about how I would go about preventing that ?

Optimally the roles should have some hierarchy where a user with a specific role can only assign roles lower than their own role ?

Geert Veenstra

Yes, that's working :-)

Thanks !

Hi Maliming,

I see you already made a change to implement TenantManager. However when I make the same changes in the EmailTemplateProvider in my code I get the following exception on starting the application :

Castle.MicroKernel.CircularDependencyException: 'Dependency cycle has been detected when trying to resolve component 'Portal.Authorization.Users.UserEmailer'. The resolution tree that resulted in the cycle is the following: Component 'Portal.Authorization.Users.UserEmailer' resolved as dependency of component 'Portal.MultiTenancy.TenantManager' resolved as dependency of component 'Portal.Net.Emailing.EmailTemplateProvider' resolved as dependency of component 'Portal.Authorization.Users.UserEmailer' resolved as dependency of component 'Abp.MultiTenancy.AbpTenantManager`2[[Portal.MultiTenancy.Tenant, Portal.Core, Version=8.7.0.0, Culture=neutral, PublicKeyToken=null],[Portal.Authorization.Users.User, Portal.Core, Version=8.7.0.0, Culture=neutral, PublicKeyToken=null]]_c27f9841-6f5e-424d-a9e8-5f4d4bf0c725' resolved as dependency of component 'Portal.MultiTenancy.TenantManager_92500322-0e0b-44d7-8311-3eb12de3148b' resolved as dependency of component 'Portal.MultiTenancy.SubscriptionExpirationCheckWorker' which is the root component being resolved. '

Hi,

I am using the {TENANCY_NAME} in the url to set the tenant based on this url.

When I am sending an email, it looks like the GetTenantLogoUrl does not work correctly. The The webUrlService.GetServerRootAddress() always returns the url without the tenant name. So http://portal.com instead of https://tenant.portal.com

For now I fixed it by adding private string GetTenancyName(int? tenantId) { return tenantId.HasValue ? TenantCache.Get(tenantId.Value).TenancyName : null; } to the EmailTemplateProvider and GetServerRootAddress(GetTenancyName(tenantId))

Is there a more generic method to get the Tenancyname based on the TenantId, I noticed there is lots of places in the code where a private function is created to get the TenancyName ?

Geert Veenstra

Hi,

There exist two forms with the same name 'OtherSettingsForm' on the Settings\Index.html view page. Because of this the setting QuickThemeSelection is not enabled.

Also, why is this setting only available when MultiTenancy is disabled ?

Hi, Using Asp.net Core MVC jQuery

Currently the setting "IsQuickThemeSelectEnabled" is only used in the AppTopBar component. But disabling this does not prevent downloading all the theme .png pictures that are in the ThemeSelectionPanel. Is is possible to also implement this setting in the layout file so it would not download these pictures/css/scripts on each page load?

Basically, what I'm trying to do is to split the localization resource files that come with ASPNETZERO into multiple files depending on context.

That is exactly what I did ... Working fine here (but like I mentioned, it only works when your Extension folder names do not start with your Project folder name). Don't know how to explain it further.

@alexanderpilhar,

Sorry, the indentation was not good.

This would be the structure of the directories:

  • Localization
    • ProjectName (this is your projectname where the original aspnetzero localization files are)
      • ProjectName.xml (for english (en))
      • ProjectName-de.xml (for german (de))
      • ProjectName-nl.xml (for dutch (nl))
      • ...
    • Extended (this is your new extension directory where your added/changed localization keys are)
      • ProjectName.xml (for english (en))
      • ProjectName-de.xml (for german (de))
      • ProjectName-nl.xml (for dutch (nl))
      • ...

The problem is the extension directory can apparently not have the name starting with ProjectName (e.g. ProjectNameExtended), somehow that will not work) so just give it another name.

Aaron, really helpful comment ... I would expect a more elaborate answer from support guys

@alexanderpilhar This should work (I had a hard time finding a solution some tome ago, documentation is not really clear on this):

Localization ProjectName ProjectName.xml ProjectName-xx.xml ... Extended ProjectName.xml ProjectName-xx.xml ...

public static void Configure(ILocalizationConfiguration localizationConfiguration)
{
    localizationConfiguration.Sources.Add(
        new DictionaryBasedLocalizationSource(
            ProjectNameConsts.LocalizationSourceName,
            new XmlEmbeddedFileLocalizationDictionaryProvider(
                typeof(PoinowLocalizationConfigurer).GetAssembly(),
                "CompanyName.ProjectName.Localization.ProjectName"
            )
        )
    );

    localizationConfiguration.Sources.Extensions.Add(
        new LocalizationSourceExtensionInfo(
            ProjectNameConsts.LocalizationSourceName,
            new XmlEmbeddedFileLocalizationDictionaryProvider(
                typeof(PoinowLocalizationConfigurer).GetAssembly(),
                "CompanyName.ProjectName.Localization.Extended"
            )
        )
    );
}

Ok, never mind. Seems I mistakenly deleted the yarn.lock on migrating which caused some packages to download a newer (not compatible) version.

Showing 1 to 10 of 39 entries