Jump to content

Custom ACP Menu Tab


HeadStand

Recommended Posts

I have a custom app, and I set up a custom menu tab in the ACP in my development environment. My acpmenu.json file looks like this:

{
    "machines": {
        "versions": {
            "tab": "posts",
            "controller": "versions",
            "do": "",
            "restriction": null
        }
    },
    "directory": {
        "settings": {
            "tab": "posts",
            "controller": "settings",
            "do": "",
            "restriction": null
        }
    }
}

and in my lang.php file, I have

'menutab__posts' => "Posts",
'menutab__posts_icon' => "laptop",

Works perfectly in my dev environment. I build the app, install on the customer site... menu tab does not show up. Suggestions? Ideas? I've been banging my head over this one for 2 days now. I've tried uninstalling and re-installing, rebuilding... nothing works. :( 

Link to comment
Share on other sites

Are there restrictions on the admin account? If there are restrictions pre-set on an account or group, rather than blanketly having all permissions, then the new application will not be automatically inherited, and will need to be set manually.

EDIT: Note, restrictions can be applied at both the module and application level. So if the administrator does not have access to the application at all, in their restrictions, then it won't show.

Link to comment
Share on other sites

Just now, Ryan Ashbrook said:

Are there restrictions on the admin account? If there are restrictions pre-set on an account or group, rather than blanketly having all permissions, then the new application will not be automatically inherited, and will need to be set manually.

I'm an Administrator. No secondary groups. No restrictions.

Link to comment
Share on other sites

26 minutes ago, HeadStand said:

I'm an Administrator. No secondary groups. No restrictions.

Are you certain there are no restrictions? What is the contents of core_admin_permission_rows? An asterisk would indicate all permissions, and inherit from new applications, and a JSON object would indicate specific permissions, with no inheritance for new applications (even if every single permission is selected).

Restrictions are the only thing, off the top of my head without seeing the site, that would cause a menu tab to not show.

Link to comment
Share on other sites

Just now, Ryan Ashbrook said:

Are you certain there are no restrictions? What is the contents of core_admin_permission_rows? An asterisk would indicate all permissions, and inherit from new applications, and a JSON object would indicate specific permissions, with no inheritance for new applications (even if every single permission is selected).

It's an asterisk.

Link to comment
Share on other sites

Feeling incredibly stupid right now. My Application::canAccess method had a permission check in there to check group permissions. I added

if( \IPS\Dispatcher::hasInstance() && \IPS\Dispatcher::i()->controllerLocation == 'admin' )
{
    return true;
}

and now it works. ** facepalm **

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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