Open Closed

Users with only the "Messages" permission cannot access Chat #10928


User avatar
0
VMPProgramador created

The problem

A user with only the Conversation → Messages permission cannot access the Chat page and is redirected to the Access Denied page.

However, granting the Conversation → Setting Management permission as well allows the page to work normally. This is unexpected, as managing settings should be independent of using Chat.

Steps to reproduce

  1. Create a permission profile with only Conversation → Messages enabled.
  2. Sign in with a user assigned to that profile and navigate to /Chat.
  3. Confirm that access is denied.
  4. Grant the profile the Setting Management permission as well and repeat the test.
  5. Confirm that the page now opens normally.

Analysis

During testing, we found that the Chat page retrieves the module's settings when it initializes, even when the user only needs to access their messages.

This request appears to be the cause of the issue. The OnInitializedAsync method in Index.razor.cs (in Volo.Chat.Blazor.MudBlazor) calls SettingsAppService.GetAsync, which requires the Chat.SettingManagement permission at class level. As a result, users without this permission cannot complete the page initialization.

Markdown supported.
Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)

1 Answer(s)
  • User Avatar
    0
    AI-Bot created
    Support Team ABP Agent
    • This behavior is caused by authorization on the Chat settings application service being enforced at class level (requires Chat.SettingManagement). Since the Chat page initializes by calling SettingsAppService.GetAsync, the whole page fails to initialize for users who only have Chat.Messaging (Conversation → Messages) and they get redirected to Access Denied.

    • In ABP/Blazor, the most practical workaround (without modifying the commercial module source) is to override/replace the Chat page component and avoid calling the settings endpoint unless the user has the Setting Management permission.

    Recommended fix (UI-side override)

    1. Override the Chat page/component from Volo.Chat.Blazor.MudBlazor (same technique used to override built-in module UI components).
    2. In your overridden OnInitializedAsync, check permission before calling SettingsAppService.GetAsync:
      • If user has Chat.SettingManagement: load settings (admin UI behavior)
      • Else: skip settings load and proceed with messaging UI using defaults

    Example pattern (conceptual):

    public override async Task OnInitializedAsync()
    {
        // ... other init
    
        if (await AuthorizationService.IsGrantedAsync("Chat.SettingManagement"))
        {
            Settings = await SettingsAppService.GetAsync();
        }
    
        // continue loading conversations/messages
    }
    

    This keeps messaging access independent from settings management while preserving settings features for authorized users.

    Alternative fix (service-side, if you own/extend backend)

    If you have a customization point (e.g., you can replace the settings app service), provide a read-only settings endpoint that is authorized with Chat.Messaging (or no permission if settings are not sensitive), and make the UI call that endpoint instead. However, this requires backend customization/replacement and is typically more invasive than the UI override.


    Sources

    • ABP Blazor UI overriding approach (used to replace module pages/components): https://docs.abp.io/en/abp/latest/UI/Blazor/Customization-Overriding-Components

    This response was generated by AI. If it didn’t solve your problem, feel free to post a new answer — our support team will jump in to help you soon.

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
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.8.0-preview. Updated on October 16, 2026, 14:19
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.