MultivendorX
-
AuthorPosts
-
-
December 1, 2022 at 1:55 AM #147117MaxenceTPParticipant
Hello,
I have added a plugin to set multiple roles to a user (vendor + administrator for example) : https://en-gb.wordpress.org/plugins/user-role-editor/
I want to enable the option “Vendor’s Backend Access”, but when I do that, even with the admin role I cannot access to the wp-admin.Is it possible to add exceptions ? For example if you have the admin role, you can bypass this rule.
Thank you
-
December 2, 2022 at 1:20 AM #147246NerdySupportExpert MoumitaKeymaster
@MaxenceTP, I presume there is a primary role and a secondary role. Make sure to set the primary role as the vendor.
But, as you are working with capabilities, then it might cause issues for the vendor’s flow also.
By default we do let vendors access the backend, so make sure you didn’t enable the backend access option : https://prnt.sc/3U0GyGeg13ya
-
December 2, 2022 at 1:57 AM #147257MaxenceTPParticipant
Even with Administrator as primary role, and vendor as secondary, I cannot access wp-admin with the “Vendor’s Backend Access” enabled :'(
-
December 2, 2022 at 1:59 AM #147258MaxenceTPParticipantThis reply has been marked as private.
-
December 2, 2022 at 10:47 AM #147275NerdySupportExpert MoumitaKeymaster
It seems like the vendor is facing a capability issue probably due to multiple role permission.
As we don’t know why this is happening, so it is quite difficult for us to shed light on the reason behind this.Whether this is a role conflict issue, just to be sure please create a new vendor, who doesn’t have any other secondary roles. Then check whether that vendor is able to access the backend.
If he is able to access the backend, then you must debug this issue. It will need you to check each capability related code -
December 2, 2022 at 11:53 PM #147297MaxenceTPParticipant
There is no problem if I only have the vendor role, I want to disable wp-admin : it’s working.
But if I’m admin + vendor, I cannot access wp-admin as MVX is blocking wp-admin when I have the vendor role.I want to add a condition, if it’s true : you can access the wp-admin, even if it’s blocked by MVX.
Do you understand ? Is there a filter / hook for that ? -
December 5, 2022 at 4:56 PM #147356MVX Support NinjaKeymaster
Hi,
using below filter we add capability for vendor.
Kindly use this filter for vendor to add capability to use admin dashboard.apply_filters('mvx_vendor_capabilities', $caps);
CopyRegards,
-
December 5, 2022 at 6:50 PM #147363MaxenceTPParticipant
I don’t really understand how this hook can solve my problem ?
I think that will be easier to add a filter in the function “restrict_wp_backend” (class-mvx-pro.php), with the vendor ID as parameter. And add the same filter in the function “remove_dashboard_header_right_panel_nav” (class-mvx-pro-frontend.php).
Can you add that filter ? Or do you have another solution ?
-
December 6, 2022 at 4:14 PM #147386NerdySupportExpert MoumitaKeymaster
Maxence, you can follow solutions like https://wordpress.org/support/topic/users-able-to-access-backend-despite-role-limitations/
-
February 9, 2023 at 2:54 PM #180105WCMp AdminKeymaster
We haven’t heard back from you, so we presume this issue has been fixed.
So we are closing this one.
If you need any further help, do open another thread.
-
-
AuthorPosts
The topic ‘Restrict wp-admin access to vendors’ is closed to new replies.