Jump to content

Permissions to show only one custom admin page to a role


nixsofar
 Share

Recommended Posts

There might be an obvious answer, but I can't figure it out:

I have an admin page containing custom HTML, based on the ProcessSimpleAdminPage module

As intended, it shows an extra tab in the admin area next to "Pages", "Setup", "Modules", "Access" for the superuser.

There is a role "editor" with permissions that let them only see the "Pages" tab.

How can I achieve that such an "editor" can also see the custom tab in addition to "Pages"?

Link to comment
Share on other sites

Create a permission called `mymodule-view`, add it to `editor` role, then in your module add a `permission` property like this

class ProcessSimpleAdminPage extends Process {

    public static function getModuleInfo() {
        return array(
            'title' => 'Process Simple Admin Page',
            'summary' => 'Simple Process module that adds new admin page with',
            'version' => 001,
            'permission' => 'mymodule-view',
            'permissions' => [
                'mymodule-view' => 'Can use my module'
            ]
        );
    }

Additionally, you can also add `permissions` property which will create the permissions for you when you install it.

 

  • Like 1
Link to comment
Share on other sites

@abdus: Looks like the information I was after. Thanks a lot!

Edit: Unfortunately no effect. Isn't there maybe anything to do at template level?

Edit #2: Success after another module un/reinstall- No idea what I did wrong the first time. – Thanks again!

Edited by nixsofar
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...