Acces Roles for custom roles

Home Forums AdRotate for WordPress Installation and Setup Acces Roles for custom roles

  • #98615

    Lennart Bader
    Badges:

    Hi Arnan,

    I just bought and installed the Pro version and I noticed something odd when assigning permissions to a custom user role.

    When doing so, ALL other roles get the same permissions. It looks like the plugin cannot determine the correct ‘level’ of the custom role.

    I for now set the adrotate roles in code when creating the custom role, but it would be good if there would be a more generic solution.

    Thanks in advance! πŸ™‚

    Lennart

    #98617

    Lennart Bader
    Badges:

    Additional: non-admin users get a permission denied error when clicking ‘AdRotate Pro’ in the menu (linking to /wp-admin/admin.php?page=adrotate).

    No problem to visit the submenu pages (like /wp-admin/admin.php?page=adrotate-ads), but it feels odd to see an error when clicking on the main menu link.

    #98626

    Arnan de Gans
    Badges:

    Role managers often make a mess of things.
    Which one do you use?

    I have not heard from others having an issue with assigning roles recently.

    #98628

    Lennart Bader
    Badges:

    Yes indeed, they do. I’ve used the ‘Reset Roles and Capabilities’ plugin to reset all roles to WP default.

    I’ve listed all roles and the list is ‘clean’.

    #99244

    Lennart Bader
    Badges:

    Hi Arnan,

    Could you please look at this:

    Additional: non-admin users get a permission denied error when clicking β€˜AdRotate Pro’ in the menu (linking to /wp-admin/admin.php?page=adrotate).

    No problem to visit the submenu pages (like /wp-admin/admin.php?page=adrotate-ads), but it feels odd to see an error when clicking on the main menu link.

    We’re about to deliver the website to the client and it is kinda unprofessional to have to explain to them not to click on the main menu item for AdRotate πŸ™‚

    Thanks!

    Lennart

    #99706

    Arnan de Gans
    Badges:

    If you use roles properly this problem doesn’t exist.
    I can’t make the top level configurable, because you need to be in there to set the user roles (Settings > Roles).
    And lowering the access to something like ‘Subscriber’ is not the solution either.

    So, the user needs to be able to ‘manage_options’ (WordPress role) to access the basic menu. This applies to the Settings menu as well.

    #99713

    Lennart Bader
    Badges:

    Hi Arnan,

    I don’t get this. ‘manage_options’ is quite a privileged role for just showing the General Info page of this plugin. πŸ˜›

    The aim is to limit access to the backend and allow the person in charge of advertising to just manage the ads. Not allowing him to manage other options.

    The Settings/User Roles menu should only be accessible by administrators in my opinion. Otherwise, regular users could gain access by changing roles?

    Give it a try. It feels really odd when you are allowed to click on a sub-menu, but not on the main menu… πŸ™‚

    Thanks,

    Lennart

    #99719

    Arnan de Gans
    Badges:

    It usually applies to admins (or equivalent), which are most commonly the ones who deal with adverts. Not authors, subscribers or contributors.

    If the top level would be something like “author” level, every lower level account would have a useless AdRotate Pro menu in their dashboard. I imagine the issue would be the reverse of what you’re trying to do and several forum topics exist with people wondering how to ‘fix’ that.

    #99727

    Lennart Bader
    Badges:

    Why not make a separate role then, that sets whether the Main Menu is accessible or not?

    If it’s only admins that commonly deal with adverts, then what is the use of the Access Roles anyway?

    Are you able to reproduce what I mean? If you set the access roles to a moderator level, for instance, you have the same issue. You can click on sub-menu items, but not on the main item.

    My aim is to help improve your plugin, not to be a pain πŸ™‚

    Thanks Arnan!

    #99734

    Arnan de Gans
    Badges:

    Today I refreshed my memory and to take another look at the roles and stuff.
    I misspoke a bit on the top level menu role.
    The menu and all options in it require specific AdRotate roles except the settings page which is hardcoded to require ‘manage_options’.

    So your menu items not working is very likely simply because your role manager is not assigning the right roles to users. Assigning the ‘adrotate_ad_manage’ role to a user should give them the right access for the basic menu.

    You can configure the AdRotate permissions in AdRotate (Pro) > Settings > Roles.

    #99792

    Lennart Bader
    Badges:

    Hi Arnan,

    Thanks for the suggestion. I’ve checked and these are the caps for this user:

    [adrotate_advertiser] => 1
    [adrotate_global_report] => 1
    [adrotate_ad_manage] => 1
    [adrotate_ad_delete] => 1
    [adrotate_group_manage] => 1
    [adrotate_group_delete] => 1
    [adrotate_schedule_manage] => 1
    [adrotate_schedule_delete] => 1
    [adrotate_advertiser_manage] => 1
    [adrotate_moderate] => 1
    [adrotate_moderate_approve] => 1

    Still not able to access the basic menu though. Any thoughts?

    Thanks!

    #100121

    Arnan de Gans
    Badges:

    If you assign the right roles and it still doesn’t work your role manager is doing something wrong.
    Don’t use a role manager, or get a better one.

Viewing 12 posts - 1 through 12 (of 12 total)

You must be logged in to reply to this topic.

You may be interested in