Activities of "bmulinari"

Hi there.

Any way to get this behavior in the permissions modal?

Hi there. In our application we implemented a page that utilizes the default ABP app services IIdentityUserAppService and IIdentityRoleAppService to list users and roles. Therefore, this page requires the permissions "AbpIdentity.Users" and "AbpIdentity.Roles" to work correctly.

So, to avoid unexpected permission errors when setting up the roles for our application, we need to implement a proper permission dependency when defining our own permissions, as explained in the documentation here and here.

With this in mind, we added the dependencies to our permission definition:

public class MyModulePermissionDefinitionProvider : PermissionDefinitionProvider
{
    public override void Define(IPermissionDefinitionContext context)
    {
        var myModuleGroupDefinition = context.AddGroup(MyModulePermissions.GroupName, L("Permission:MyModule"));
        var myModuleGroup = myModuleGroupDefinition.AddPermission(MyModulePermissions.Home, L("Permission:MyModule:Home"), MultiTenancySides.Tenant);

        var reportsPermissions = myModuleGroup.AddChild(MyModulePermissions.Reports.Default, L("Permission:MyModule:Reports"), MultiTenancySides.Tenant);
        reportsPermissions.AddChild(MyModulePermissions.Reports.ReportManagement, L("Permission:MyModule:Reports:ReportManagement"), MultiTenancySides.Tenant)
            .RequirePermissions("AbpIdentity.Users", "AbpIdentity.Roles"); // this is what we added
    }

    private static LocalizableString L(string name)
    {
        return LocalizableString.Create<MyModuleResource>(name);
    }
}

What I expected to happen: for my custom permission MyModulePermissions.Reports.ReportManagement to always require the permissions "AbpIdentity.Users" and "AbpIdentity.Roles", in a way that they should be automatically selected in the permissions pop-up when my custom permission is selected, or at least give me an error and not allow me to save until the dependent permissions are also selected, making the permission dependencies clear and mandatory when setting up the permissions for users or roles.

What actually happens: in the permissions pop-up I can select my custom permission MyModulePermissions.Reports.ReportManagement and save without any action or feedback that my custom permission depends on other permissions. From my tests, all RequirePermissions does is consider my custom permission not granted unless the other required permissions are also granted, which is very confusing since my menu entry won't appear for the user even when they have that permission granted (but not its dependencies).

Am I missing something or is this the expected behavior? If so, is there a way to implement permission dependencies in the way I described?

Thanks!

I appreciate the AI-generated response, but I'd like to hear the ABP team's input on this matter.

Thanks!

Hi,

From what I could find in the documentation and in this article, bundling JavaScript or CSS files is only mentioned for Blazor WebAssembly, no mention of Blazor Server. From my tests the BundleContributor approach does not seem to work for Blazor Server.

For now the workaround has been collocated JavaScript files with specific components.

Does ABP offer any way to do file bundling in Blazor Server? What would be the correct approach?

I have verified that adding UseAbpTimeZone to my application initialization does seem to solve the issue in the /audit-logs page and it now shows the correct local time:

Still, it's not clear to me when to have UseAbpTimeZone or not (I couldn't find any documentation on it besides your article).

The inconsistency shown in my previous post does seem like a bug... 🤔

Hi there.

I have migrated my application to ABP 9.2.0 and applied the migrations that updated all timestamp columns in the database to type timestamp without time zone. I'm using both Npgsql.EnableLegacyTimestampBehavior and AbpClockOptions.Kind = DateTimeKind.Utc. With this, I believe now I have the correct time zone configurations both in application and database according to your instructions.

With that said, I still observe the issue I reported initially, where the time displayed in the audit logs page is incorrect, ignoring the time zone settings (application or account). Here are some screenshots:


/audit-logs page, showing UTC time (❌ incorrect)


AbpAuditLogs table, storing UTC time (✅ correct)


/Account/SecurityLogs page, showing local time (✅ correct)


AbpSecurityLogs table, storing UTC time (✅ correct)

Sorry for the delay on this. I think it's important to explain in more details my concern regarding the correct time zone settings.

When we initially migrated to PostgreSQL, the migration guide didn't include the instruction to use the EnableLegacyTimestampBehavior setting. That means that when we followed the old version of the guide, we got the same error reported here, and in this same thread you can see that the solution is to set AbpClockOptions.Kind to DateTimeKind.Utc to fix the error, so that's what we did and it worked.

So now that the migration guide has been updated to include the EnableLegacyTimestampBehavior setting, the AbpClockOptions setting we used seems no longer needed.

However, if I try to include the EnableLegacyTimestampBehavior setting now, that results in changes to all timestamp columns in the DB (migrations) since this setting controls the type for these columns. For example:

// ...
migrationBuilder.AlterColumn<DateTime>(
    name: "DeletionTime",
    table: "AbpUsers",
    type: "timestamp without time zone",
    nullable: true,
    oldClrType: typeof(DateTime),
    oldType: "timestamp with time zone",
    oldNullable: true);
// ...

I have not applied this migration since I'm not sure if it's the right thing to do in this case.

Considering this situation, what would be the recommended course of action? I think that before I can reliably report any problem related to time zone, first I need to ensure everything is correct in my application and database.

Hi,

I see that there were a bunch of changes related to time zones in 9.2.0, so I updated to it to test and the issue I described above still persists in 9.2.0. The article you linked is the same one I linked.

Also, I would appreciate if you could confirm the correct settings to use in our case.

Thanks!

Question

Hi there.

We have identified an inconsistency in the audit logs page (/audit-logs), where the time shown in the log entries is always fixed to the value saved in the database (UTC), so any time zone setting is ignored in this page (host time zone or user account time zone setting).

This does not happen in the security logs (/Account/SecurityLogs) where I can verify that it correctly displays the time based on the time zone setting.

Is this intended or a bug?

For added context, we are currently using the following settings related to the time zone:

  • Npgsql.EnableLegacyTimestampBehavior enabled, since we are using PostgreSQL (as instructed here).
  • AbpClockOptions.Kind set to DateTimeKind.Utc (as instructed here).

Should both of these settings be used at the same time? I just want to ensure we are configuring time zones correctly in the application.

Awesome, thank you.

Showing 1 to 10 of 29 entries
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.1.0-preview. Updated on October 30, 2025, 06:33