This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

Mohsin
Mohsin

I hope I’m not being ignorant and asking the wrong thing. If so please point out the alternative way of solving this. It so happens that I don’t want my clients to see certain widgets under the Add Widget dialog from dashboard. For example, I don’t want my clients to be able to see new updates to OctoberCMS core and I would rather prefer to update it for him by myself. It would be nice to have a permission system to prevent the widget from being listed in the dashboard even if he has the view dashboard setting enabled i.e. it would be nice to have more fine-grained control over the listed widgets. Also, if it may be nice to hide the Add Widget button too perhaps. That too may solve this as I’ll set the fixed number of widgets for him and he can manually move them or resize them but never add / remove widgets.

Last updated

daftspunky
daftspunky

Interesting suggestion, if there was a pull request for this, it would be accepted.

slipgrom3145
slipgrom3145

Mohsin said:

I hope I’m not being ignorant and asking the wrong thing. If so please point out the alternative way of solving this. It so happens that I don’t want my clients to see certain widgets under the Add Widget dialog from dashboard. For example, I don’t want my clients to be able to see new updates to OctoberCMS core and I would rather prefer to update it for him by myself. It would be nice to have a permission system to prevent the widget from being listed in the dashboard even if he has the view dashboard setting enabled i.e. it would be nice to have more fine-grained control over the listed widgets. Also, if it may be nice to hide the Add Widget button too perhaps. That too may solve this as I’ll set the fixed number of widgets for him and he can manually move them or resize them but never add / remove widgets.

My little fix:

1) Plugin.php
public function registerPermissions()
{

    return [
        ....
        some permissions
        ....
        'gromit.crm.widget' => [
            'tab' => 'Widgets',
            'label' => 'Allow to widgets settings',
            'order' => 61,
        ],
    ];
}

public function boot()
{
    ....
    some boot logic
    ....
    Event::listen('backend.page.beforeDisplay', 
        function ($controller, $action, $params) {
            if(!BackendAuth::getUser()->hasAccess('gromit.crm.widgets')){
                $controller->addCss('/widgets.css', '1.1.0');
            }
    });
}
2) widgets.css
.report-container > ul .item .content .edit-widget,
.report-container > ul .item .content .close,
.report-container > ul .item .content .drag-handle,
#ReportContainer-container-toolbar{
    display: none !important;
}

Last updated

JeffGoldblum
JeffGoldblum

Ask and you shall receive (two and a half years later!): https://github.com/octobercms/docs/commit/3b5dc65b6a94fe1baf3ac5d80ffacbfcfb15a3dc https://github.com/octobercms/october/commit/1fc8dc6fd4c9b9a522ea436508a9b17b8a1eed42

Functionality will be available in Build 448 (or pull straight from the develop branch to get started using it right away).

Last updated

1-4 of 4

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.