Change WordPress user roles and capabilities › Forums › Give user access to plugin – how to › What are the capabilities for si-contact-form plugin
- This topic has 12 replies, 2 voices, and was last updated 8 years, 6 months ago by Vladimir.
-
AuthorPosts
-
12/08/2015 at 23:43 #1656uclaseaswpParticipant
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!
13/08/2015 at 06:39 #1658VladimirKeymasterHi, 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.pngYou 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.14/03/2016 at 19:52 #2129uclaseaswpParticipantHi 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.
14/03/2016 at 20:03 #2130uclaseaswpParticipantHi, 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.
14/03/2016 at 21:17 #2131uclaseaswpParticipantHi 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’);
306c30615/03/2016 at 13:41 #2132VladimirKeymasterHi,
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).15/03/2016 at 17:08 #2133uclaseaswpParticipantThank you!
30/03/2016 at 22:19 #2166uclaseaswpParticipantHi 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!
01/04/2016 at 02:07 #2169VladimirKeymasterHi,
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.01/04/2016 at 21:28 #2170uclaseaswpParticipantHi 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”?
02/04/2016 at 01:08 #2172VladimirKeymasterHi,
You may select what to block at the top of “Admin Menu” window at “Users->User Role Editor”:
04/04/2016 at 18:15 #2182uclaseaswpParticipantI 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#emailSo 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.
05/04/2016 at 03:16 #2183VladimirKeymasterThanks 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. -
AuthorPosts
- You must be logged in to reply to this topic.