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
        ),
    );
}
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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.