Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagephp
title/plugins/my_plugin/my_plugin_plugin.php
<?php
class MyPluginPlugin extends Plugin {
 
    ...
 
    public function getPermissionGroups()
    {
        return [
            [
                'name' => 'Permission Group Name',
                'level' => 'staff',
                'alias' => 'my_plugin.my_controller'
            ]
        ];
    }
}
?>

Once you have a permission group to reference, define your permissions inside the getPermissions() method with the appropriate parameters to create your access permission, setting 'alias' as the plugin.controller (e.g. MyPlugin plugin FooBar controller becomes my_plugin.foo_bar) and 'action' as the method to control (use * for all methods in a controller).

...