Change WordPress user roles and capabilities Forums Give user access to plugin – how to What are the capabilities for si-contact-form plugin

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #1656
    uclaseaswp
    Participant

    Hi, I activated https://wordpress.org/plugins/si-contact-form, but when I went to Users > User Role Editor > [pick a role], I could not find any capabilities related to this new plugin. Do you know what they are so that I can add them via “Add Capability” button? Thank you!

    #1658
    Vladimir
    Keymaster

    Hi, this plugin does not introduce its own capabilities. It uses built-in WordPress manage_options user capability for its menu item:
    https://storage.googleapis.com/role-editor/downloads/support/si-contact-form-capability.png

    You may find user capability for any admin menu item with a help of “Admin access add-on”:
    https://www.role-editor.com/block-admin-menu-items
    Just open it for the Administrator role and find needed menu item in the list.

    #2129
    uclaseaswp
    Participant

    Hi Vladimir, I’ve been doing as you suggested above, but all of a sudden (not sure if it is the result of the upgrade to 4.23.2 and I would have to roll back to find out, but I cannot roll back), manage_options causes Event Manage plugin Events > Settings to appear and I am not able to block this Settings with Admin Menu Access module. Please advise. A hack to either your plugin or the contact form plugin will be ok if there is no other option. I’m not familiar with wordpress development, so I would not know where to hack. Thank you.

    #2130
    uclaseaswp
    Participant

    Hi, please note that while I do use Admin Menu Access module to block Settings (when I use manage_options), I cannot block Events > Settings, which is outside of Settings. If I can block Events > Settings, that is an option too. The ideal option is to have own capability for the contact form plugin, so I don’t need to enable the dangerous manage_options and then have to use Admin Menu Access to disable things.

    #2131
    uclaseaswp
    Participant

    Hi again, I am now able to prevent Events Manager plugin’s Events > Settings from appearing when manage_options is selected, but changing its code as follow (changed manage_options to update_plugins). However, I’m suspecting that there is a bug in the Admin Menu Access module that is preventing me to block Dashboard > Events > Settings when manage_options is selected . Note that I can block Dashboard > Settings. Could you please let me know if this is a bug?

    diff plugins/events-manager/admin/em-admin.php plugins/events-manager/admin/em-admin.php.ORIG
    40,41c40,41
    < $plugin_pages[‘options’] = add_submenu_page(‘edit.php?post_type=’.EM_POST_TYPE_EVENT, __(‘Events Manager Settings’,’events-manager’),__(‘Settings’,’events-manager’), ‘update_plugins’, “events-manager-options”, ’em_admin_options_page’);
    < $plugin_pages[‘help’] = add_submenu_page(‘edit.php?post_type=’.EM_POST_TYPE_EVENT, __(‘Getting Help for Events Manager’,’events-manager’),__(‘Help’,’events-manager’), ‘update_plugins’, “events-manager-help”, ’em_admin_help_page’);

    > $plugin_pages[‘options’] = add_submenu_page(‘edit.php?post_type=’.EM_POST_TYPE_EVENT, __(‘Events Manager Settings’,’events-manager’),__(‘Settings’,’events-manager’), ‘manage_options’, “events-manager-options”, ’em_admin_options_page’);
    > $plugin_pages[‘help’] = add_submenu_page(‘edit.php?post_type=’.EM_POST_TYPE_EVENT, __(‘Getting Help for Events Manager’,’events-manager’),__(‘Help’,’events-manager’), ‘manage_options’, “events-manager-help”, ’em_admin_help_page’);
    306c306

    #2132
    Vladimir
    Keymaster

    Hi,

    I confirm the bug at version 4.23.2 ‘Admin Menu Access’ module. It removes blocked menu item with additional parameters, like ‘Events-Settings’

    
    edit.php?post_type=event&page=events-manager-options
    

    but allows access it via direct URL.
    This bug will be fixed by upcoming version 4.23.3 (this week).

    #2133
    uclaseaswp
    Participant

    Thank you!

    #2166
    uclaseaswp
    Participant

    Hi Vladimir, I upgraded to 4.24.3, but I still cannot block Events-Settings. The only different between version 4.23.2 and 4.24.3 that I noticed is that manage_options’s Admin Menu now has Settings > Shibboleth in 4.24.3, but does not have this in 4.23.2. I have Shibboleth installed when in both 4.23.2 and 4.24.3. Shibboleth was not a problem though since I blocked the entire Settings. However, Events-Settings is a problem. Could you please check? Thanks!

    #2169
    Vladimir
    Keymaster

    Hi,

    I checked with the latest 4.24.4 with these results:
    1) Blocked “Events->Settings” menu item is removed from the admin menu as expected;
    2) edit.php?post_type=event&page=events-manager-options#general URL direct access is blocked when you use “Block Selected” model
    3) edit.php?post_type=event&page=events-manager-options#general direct access is not blocked when you use “Block not selected” model. So you can not use “block not selected” model with this plugin. With this model I block only links which belongs to main menu, not selected, and not located inside allowed pages. As you can see ‘edit.php?post_type=event’ is allowed in this case.
    I see that this logic may be enhanced. I will work in this direction. But current version work this way.

    #2170
    uclaseaswp
    Participant

    Hi Vladimir, I’m totally lost about “Block Selected” model and “Block not selected” model. Where do I go to do “Block Selected” or “Block not selected”?

    #2172
    Vladimir
    Keymaster

    Hi,

    You may select what to block at the top of “Admin Menu” window at “Users->User Role Editor”:
    block selected model

    #2182
    uclaseaswp
    Participant

    I see. I always use “Block Selected” model, but I’m not using the default “author” role. I created my own role and added “manage_options” capability and was trying to block all in Events > Settings:

    edit.php?post_type=event&page=events-manager-options#general
    edit.php?post_type=event&page=events-manager-options#pages
    edit.php?post_type=event&page=events-manager-options#format
    edit.php?post_type=event&page=events-manager-options#email

    So what you’re explaining is not working for my own role with added “manage_options” capability. It’s ok, I will hack the code for Events Manager instead.

    #2183
    Vladimir
    Keymaster

    Thanks for the information.

    I created a copy of author role, added ‘manage_options’ capability. Marked ‘Events->Settings’ as blocked. I do not see this menu item. I can not access it via direct URLs (tried all from your list).
    It’s strange that we get the different results. The recent test was done with version 4.24.5.

Viewing 13 posts - 1 through 13 (of 13 total)
  • You must be logged in to reply to this topic.