Change WordPress user roles and capabilities › Forums › Restrict or Permit access inside WordPress – how to › Login WordPress Dashboard
26/02/2016 at 20:49 #2043
Great plugin. I purchased the Pro version after our chat on the free plugin. I am liking the Admin Menu Access.
I have a query regarding the WordPress Dashboard page that is shown upon login. Is it possible to hide some of these boxes for specific user role?
I am running WooCommerce and I do not want the staff knowing the totals of the month etc, hence I would like to hide ‘WooCommerce Status’ also I want to hide default boxes like ‘At a glance’ and ‘Activity’.
Let me know if this is possible.
Jawad27/02/2016 at 01:57 #2045
Thanks for the good feedback.
You may use “Meta boxes access” add-on:
Do not forget “to show available meta boxes” to this add-on 1st – visit ‘Dashboard’ page in order add-on may see what meta boxes are currently available.27/02/2016 at 23:43 #2047
Thanks for that, I will try this. Also, is it possible to block plugin notification which appear at the top?
Jawad28/02/2016 at 01:32 #204928/02/2016 at 01:39 #2050
Did you open Meta Boxes after you visited this ‘edit product’ page?28/02/2016 at 01:41 #2051
Thanks for your reply. Yes, I visited the page. It is the regular WooCommerce Products page: /wp-admin/edit.php?post_type=product
I am trying to hide some of the screen option on this page, but these do not appear in the Meta Box module.
Jawad28/02/2016 at 01:52 #2052
I understood now.
It’s a products list page. Screen options here are not related to the meta boxes. These options are table columns. It’s not possible to hide them with current version of URE currently. I will look what it’s possible to do with it.28/02/2016 at 01:58 #2053
Thanks for looking into it!
1) Also, did you check my screenshot, there is a plugin notification – is it possible to disable these from appearing in the first place or do the users have to ‘dismiss’ them to get rid of it.
2) Also, how do I stop users from ‘Add Product’ in WooCommerce?
Jawad28/02/2016 at 02:10 #2054
1) Admin notices – not so fast. I’m working on the answer currently.
2) You may turn ON this option ‘Activate “Create” capability for posts/pages/custom post types”. ‘create_posts’, ‘create_pages’, ‘create_products’ capabilities will be appear in the User Role Editor. Add them to the roles which should add posts, pages, products and other registered custom post types. Role without ‘create_products’ capability will can not add new product – just edit the existing one.28/02/2016 at 02:22 #2055
Cool thanks got it working!
I also enabled ‘create_shop_orders’ but when I go to Add Order page it says I do not have sufficient privilege.
Does Creating Order need additional capabilities?
Jawad28/02/2016 at 02:27 #2056
Yes, ‘edit_shop_orders’ is a required one.28/02/2016 at 02:38 #2057
1) I have ‘edit_shop_order’ and ‘edit_shop_orders’ both ticked but still cannot access page? Please see below my current setup:
2) Also what is the difference between the two? I see this with other capabilities as well,
‘delete_product’ , ‘delete_products’ / ‘edit_product’ , ‘edit_products’ – they seem similar?
Jawad28/02/2016 at 03:47 #205928/02/2016 at 04:56 #2060
1) Check if there are no any restrictions set for this user at his ‘Edit posts restrictions’ section.
2) ‘edit_post’, ‘delete_post’ are so called meta capabilities which are mapped by WordPress to the real user capabilities ‘edit_posts’, ‘edit_others_posts’, etc.
For example you check if user can edit the post. If it’s his post, it’s enough to have ‘edit_posts’. Then if this post is published, it’s needed to have ‘edit_published_posts’.
That is for 1 ‘edit_post’ meta capability 2 real capabilities are required. In case user is not an author of this post, WordPress will check if user has ‘edit_others_posts’, etc.
wp-includes/capabilities.php map_meta_cap()function for more details.
There is no need to add meta capabilities directly to the roles by my opinion. But WooCommerce makes this.28/02/2016 at 21:33 #2062
Wow – thanks for releasing such a quick fix to hide Admin notices, it works brilliantly!
1) When you said ‘Edit posts restrictions’ did you mean enable ‘edit_posts’ and ‘create_posts’ capabilities?
When I go to create order – I see this PHP error message?
Notice: Undefined index: id in /wp-content/plugins/user-role-editor-pro/includes/pro/classes/meta-boxes.php on line 46 Warning: Cannot modify header information - headers already sent by (output started at /wp-content/plugins/user-role-editor-pro/includes/pro/classes/meta-boxes.php:46) in /wp-includes/option.php on line 820 Warning: Cannot modify header information - headers already sent by (output started at /wp-content/plugins/user-role-editor-pro/includes/pro/classes/meta-boxes.php:46) in /wp-includes/option.php on line 821
2) I am not sure I quite understand. But, if I enable ‘delete_product’ should I also enable ‘delete_products’ or do they affect different capabilities?
- You must be logged in to reply to this topic.