<p>There's not a native way to do this, but you might want to consider adding it as a <a href="http://feedback.craftcms.com" rel="nofollow">feature request</a>.</p>

<p>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 <a href="https://github.com/lindseydiloreto/craft-cpjs" rel="nofollow">Control Panel JS</a> plugin.</p>

CC BY-SA 3.0
2016-05-14T03:41:58.437Z
2016-05-14T03:41:58.437Z
Brad Bell
<p>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:</p>

<pre><code>/**
 * @return array
 */
public function registerUserPermissions()
{
    return array(
        'my-permission' =&gt; array(
            'label' =&gt; Craft::t('Edit Settings'),
            //****ENABLE BY DEFAULT****
            'enable'=&gt; true
        ),
    );
}
</code></pre>

<permissions>
Is there any way to set enable by default a permission on the registerUserPermissions hook?
# Is there any way to set enable by default a permission on the registerUserPermissions hook?

(Asked by: username_0 on 2016-05-13)

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

**Tags:** permissions


---

## 1 answers

### Answer by username_1 on 2016-05-14. Score: 1 | Accepted answer

There's not a native way to do this, but you might want to consider adding it as a [feature request](http://feedback.craftcms.com).

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](https://github.com/lindseydiloreto/craft-cpjs) plugin.


---

