New: Learn Statamic on Laracasts!

We've retired the forum in favor of GitHub Discussions.

New conversations can be started on GitHub. Existing conversations will remain for a while longer.

Head over to GitHub →

Widgets Permissions

Patrik Kernke April 9, 2021 by Patrik Kernke

Hi together,

is there a way to display / hide a widget based on permission? E.g. someone who is not allowed to see / edit form responses sees the form widgets. Or is there something like a can attribute?

// config/statamic/cp.php
'widgets' => [
            'type' => 'form',
            'form' => 'contact', // name of your form
            'fields' => ['fullname'],
            'width' => 50,
            'limit' => 10,
            'can' => 'view contact form submissions' // missing? 

Or is there another way to solve it for existing and custom widgets?

>>>>>>> Unanswered <<<<<<<
1 Reply