Skip to content

Feature Request: Improved roles support #151

@DaWoblefet

Description

@DaWoblefet

Love the tool! I have a couple feature requests. First, it would be nice to be able to toggle permissions for the plugin in the tool's settings, as a convenience feature instead of hooking into the aal_init_roles filter. Just a QoL thing.

Second, when using the aal_init_roles filter, it doesn't actually hide the plugin from the user in the menubar. It does restrict their access, but it'd be nice to properly remove the plugin when they don't have the correct role. So instead of:

image

it's more like this, where it's not displayed at all:

image

This is the associated code snippet I'm using to model the behavior above. Of course, this would need to be adjusted to handle what roles are actually allowed.

function hide_activity_log_from_editors() {
    global $user_ID;
    if (!current_user_can('administrator')) {
        remove_menu_page('activity_log_page');
    }
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions