Relationships and capabilities
Support › MB Relationships › Relationships and capabilities
- This topic has 8 replies, 3 voices, and was last updated 4 months ago by
Way Leong.
-
AuthorPosts
-
April 20, 2023 at 11:40 AM #41551
Olivier
ParticipantMy website will have many users with different roles. I notice that the "Relationships" submenu under "New" (in the admin bar) is showing up for my Contributor role, and the Relationships metabox is showing up on every post type using one, for all roles that can open said post type.
I would like to restrict access and usage of Relationships to only specific roles (especially the ability to create new relationships via the New menu!). I'm using the Members plugin to customize roles and capabilities. Ideally, I would like to create a capability to 1) create a new Relationship, and another one for 2) accessing/setting Relationships in posts. Is that possible?
April 20, 2023 at 11:51 AM #41552Olivier
ParticipantEDIT: as for the New > Relationships submenu, a Contributor cannot actually create a new relationship. It leads to a page with the only option to add a
Title
andSubmit for Review
. So at least they're not able to create new relationships -- but it's also a completely useless and potentially confusing menu, so I'd love to remove itApril 20, 2023 at 7:21 PM #41561Peter
ModeratorHello,
The user role permission is beyond the scope of support of Meta Box. However, if you want to remove the Meta Box menu for a specific role, please follow this topic https://support.metabox.io/topic/hiding-meta-box-plugin-from-wordpress-dashboard-menu-for-non-admins/
April 20, 2023 at 11:27 PM #41568Olivier
ParticipantThanks Peter. So if you say it's beyond the scope of Meta Box, am I correct in understanding that Meta Box natively registers no capability that can be used to control permissions, and that it otherwise offers no feature or hooks to be used in a multi role environment?
I see MB registers at least 3 capabilities
- create_metabox_field_groups
- delete_metabox_field_groups
- edit_metabox_field_groupsBut that's all - is that correct?
April 22, 2023 at 9:17 AM #41586Peter
ModeratorHello,
There are 3 capabilities registered to control the field group, not the relationship. You can find them in the file /meta-box-builder/src/PostType.php
But Meta Box does not support controlling the capabilities for user roles, it is the feature of a third-party plugin. I hope that makes sense.April 23, 2023 at 6:45 AM #41591Olivier
ParticipantPeter,
I think I understand - and I'm not expecting MetaBox to manage capabilities. But for example when creating a CPT with MetaBox, there is a
Capability type
option, and one can choose either Post, Page, or Custom.By choosing Custom, I can then use another plugin to manage these capabilities for my user roles.
I would like the same flexibility for custom taxonomies and for Relationships. Basic capabilities such as read/edit/create would do the job. So my question is whether MetaBox can define the capabilities so that I can manage it with a third-party plugin.
April 23, 2023 at 3:33 PM #41592Peter
ModeratorHello,
Currently, there are no capabilities like that for other default post types of Meta Box, just for CPT
meta-box
(Field Groups). It would be a feature request and I will inform our development team to consider supporting this feature in future updates.April 27, 2023 at 2:36 PM #41632Olivier
ParticipantI understand - thank you Peter
December 23, 2024 at 11:36 AM #47221Way Leong
ParticipantHi, would like to check whether this feature be possible anytime soon? What are the third-party plugin would recommend?
-
AuthorPosts
- You must be logged in to reply to this topic.