Base solution for your next web application

Activities of "bilalhaidar"

Hello I am reading through the development guide and noticed the configuration for multitenancy applications.

Do I have to use a separate subdomain for each tenant in the application? Are there alternatives?

Thanks Bilal

Hi

I understand that this template adds an interceptor for. .cshtml files to be rendered by asp.net mvc and returned to client.

I have a question related to securing razor views.

Is there a built-in way to show/hide views based on permissions? Also even if user tries to access view by typing in url to prevent him.

I'm trying to secure my views as I have a requirement some groups can access certain views others cannot.

I appreciate your assistance.

Regards Bilal

Question

Hi,

In the case of using Aggregate Roots. I noticed that in the template, with any change in an entity, the data is being saved to the database (UOW).

In the case of Aggregate Roots, once you are adding objects, updating, etc. then you would save changes to the database. (DDD)

How to have the same behavior in a sense not to save to the database at every field change but rather group all changes at once?

To illustrate more, consider Event aggregate root and one of the collections it manages is EventRegistration. So when following DDD guidelines, I would create a new event registration and add it to the collection of event registrations on Event aggregate root. Then, I would save to database by calling Update() or so.

I cannot figure out how to visualize the above when using the boilertemplate. Shall I disable UOW and use it manually? Or is there a better approach?

Thanks

Hi, I've seen some code samples based on this template. When inside Application Layer, I don't see any code to check for validation or make use of Validation Data Annotation.

In ASP.NET I would do that in the Controllers before proceeding into checking business logic in the Domain Core.

What's the recommendation when using this template? Where shall I run those validation data annotations especially that I need to notify the client of such validitions.

Thank you, Regards

Hi,

I visited this link and it says, not found:

<a class="postlink" href="https://github.com/aspnetzero/aspnet-zero/releases">https://github.com/aspnetzero/aspnet-zero/releases</a>

What is the correct URL for GitHub?

Thanks, Bilal

Hi,

I just downloaded a project. When I compile the entire solution in VS, I got the error in the Web app:

tsc.exe exited with code 1

any idea?

Thanks

Hello,

I am still very new to this template and I got overwhelmed seeing all these features.

Is there a user-guide documentation on how to use and configure existing features?

For example, I want to configure an Admin per Host. Then create a new Tenant with its own Admin that can access only that tenant and create users only under that tenant.

Thanks, Bilal

Hello,

I noticed something which doesn't make sense in the AppSettingProvider when it comes to adding a new SettingDefinition for the AllowSelfRegistration.

The code uses

ConfigurationManager.AppSettings[AppSettings.TenantMangement.UseCaptchaOnRegistration]

Should it use something like this?

ConfigurationManager.AppSettings[AppSettings.TenantMangement.AllowSelfRegistration]

This is the code for the AppSettingsProvider I have:

public class AppSettingProvider : SettingProvider
    {
        public override IEnumerable<SettingDefinition> GetSettingDefinitions(SettingDefinitionProviderContext context)
        {
            context.Manager.GetSettingDefinition(AbpZeroSettingNames.UserManagement.TwoFactorLogin.IsEnabled).DefaultValue = false.ToString().ToLowerInvariant();

            var defaultPasswordComplexitySetting = new PasswordComplexitySetting
            {
                MinLength = 6,
                MaxLength = 15,
                UseNumbers = true,
                UseUpperCaseLetters = false,
                UseLowerCaseLetters = true,
                UsePunctuations = false,
            };

            return new[]
                   {
                       //Host settings
                        new SettingDefinition(AppSettings.TenantManagement.AllowSelfRegistration,ConfigurationManager.AppSettings[AppSettings.TenantManagement.UseCaptchaOnRegistration] ?? "true"),
                        new SettingDefinition(AppSettings.TenantManagement.IsNewRegisteredTenantActiveByDefault,ConfigurationManager.AppSettings[AppSettings.TenantManagement.IsNewRegisteredTenantActiveByDefault] ??"false"),
                        new SettingDefinition(AppSettings.TenantManagement.UseCaptchaOnRegistration,ConfigurationManager.AppSettings[AppSettings.TenantManagement.UseCaptchaOnRegistration] ?? "true"),
                        new SettingDefinition(AppSettings.TenantManagement.DefaultEdition,ConfigurationManager.AppSettings[AppSettings.TenantManagement.DefaultEdition] ?? ""),
                        new SettingDefinition(AppSettings.Security.PasswordComplexity, defaultPasswordComplexitySetting.ToJsonString(),scopes: SettingScopes.Application | SettingScopes.Tenant),

                        //Tenant settings
                        new SettingDefinition(AppSettings.UserManagement.AllowSelfRegistration, ConfigurationManager.AppSettings[AppSettings.UserManagement.UseCaptchaOnRegistration] ?? "true", scopes: SettingScopes.Tenant),
                        new SettingDefinition(AppSettings.UserManagement.IsNewRegisteredUserActiveByDefault, ConfigurationManager.AppSettings[AppSettings.UserManagement.IsNewRegisteredUserActiveByDefault] ?? "false", scopes: SettingScopes.Tenant),
                        new SettingDefinition(AppSettings.UserManagement.UseCaptchaOnRegistration, ConfigurationManager.AppSettings[AppSettings.UserManagement.UseCaptchaOnRegistration] ?? "true", scopes: SettingScopes.Tenant)
                   };
        }
    }

Thank you, Bilal

Hi, I read this in the documentation:

Note: In a multi-tenant application, two factor authentication is available to tenants only if it's enabled in the host settings. Also, email verification and SMS verification settings are only available in the host side. This is by design.

What do you mean by SMS and Email verification are only available in the host side. In other words, if admin of host enables SMS Verification, then all tenants would use SMS Verification without being able to disable or so?

Thanks

Question

Hi,

In the AccountController.cs code I noticed the following:

await _notificationSubscriptionManager.SubscribeToAllAvailableNotificationsAsync(user.ToUserIdentifier());

When defining Notifications, where do we specify notifications that is available for users? What is meant by the code above?

So far I noticed there are only 2 notifications defined. So how does Notification work in this case?

context.Manager.Add(
                new NotificationDefinition(
                    AppNotificationNames.NewUserRegistered,
                    displayName: L("NewUserRegisteredNotificationDefinition"),
                    permissionDependency: new SimplePermissionDependency(AppPermissions.Pages_Administration_Users)
                    )
                );

            context.Manager.Add(
                new NotificationDefinition(
                    AppNotificationNames.NewTenantRegistered,
                    displayName: L("NewTenantRegisteredNotificationDefinition"),
                    permissionDependency: new SimplePermissionDependency(AppPermissions.Pages_Tenants)
                    )
                );

Thanks

Showing 1 to 10 of 174 entries