2

When I create a permission using the registerUserPermissions hook I would like everyone, in all user groups have access to that permission. An admin has to take an explicit step to restrict access to that pemission. Something like this:

/**
 * @return array
 */
public function registerUserPermissions()
{
    return array(
        'my-permission' => array(
            'label' => Craft::t('Edit Settings'),
            //****ENABLE BY DEFAULT****
            'enable'=> true
        ),
    );
}
Andre L.
  • 357
  • 1
  • 9

1 Answers1

1

There's not a native way to do this, but you might want to consider adding it as a feature request.

In the meantime, you might be able to work around it a bit with some custom JS in the control panel and using something like the Control Panel JS plugin.

Brad Bell
  • 67,440
  • 6
  • 73
  • 143