Open Closed

How to hide edit mode switch on Dashboard #10205


0
visility created

Prerequisites

MVC 10

If issue related with ABP Framework

latest

If issue is about UI

I would expect that the permission tree would prevent a user from editing the dashboard when Pages/Adminstration is all unchecked, but that is not the case. Am I misunderstanding something? Thank you


4 Answer(s)
  • 0
    ismcagdas created
    Support Team

    Hi @visility

    When a user edits the dashboard, user edits only for the current account. So, the changes will be saved only for that specific user. This is not a system wide modification.

  • 0
    visility created

    hello Ismcagdas If I set up an account for a user and don't flag adminstration for this user - I think it would make sense that the user is not able to mess up the dashboard. Please consider for an update. Thanks, Th√łger

  • 0
    ismcagdas created
    Support Team

    Hi @visility

    Thanks, that is also a valid use case. But, instead of using Administration, we can create a new permission. This permisison will be enabled for all users by default. You can then revoke this permission from any user or role you want.

    I have created an issue, you can follow https://github.com/aspnetzero/aspnet-zero-core/issues/3879

  • 0
    jdavis01 created

    Here is my solution.. It gives me the ability to allow anyone I want to edit a dashboard

    I added a Permission called Pages.Tenant.Dashboard.Edit to the AppPermissions.cs file in the Core Project ` //TENANT-SPECIFIC PERMISSIONS

        public const string Pages_Tenant_Dashboard = "Pages.Tenant.Dashboard";
        public const string Pages_Tenant_Dashboard_Edit = "Pages.Tenant.Dashboard.Edit";
    

    ` Then in the App/Areas/Views/Shared/Components/CustomizeableDashboard/index.cshtml view I modified the following code to look for dashboard edit permissions..

    @if (IsGranted(AppPermissions.Pages_Tenant_Dashboard_Edit)) { <span class="switch switch-icon"> <label> <input type="checkbox" id="EditableCheckbox"> <span></span> </label> </span> <strong class="p-2 pt-4 dashboard-header-text-edit-mode"> @L("EditMode") </strong> }