-
Notifications
You must be signed in to change notification settings - Fork 6
feat: adjust capabilities #236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: trunk
Are you sure you want to change the base?
Conversation
dbe4287 to
d8dfad7
Compare
naxoc
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested this locally. It does indeed make the menu item go away, but it is also gone for my admin user. Should the capability be added/registered somewhere for it to work?
| 'capabilities' => [ | ||
| 'create_posts' => 'not_a_real_capability', // Set to a fake capability to remove "add new" button. | ||
| 'create_posts' => 'not_a_real_capability', // Set to a fake capability to remove "add new" button. | ||
| 'edit_posts' => \Newspack_Network\Admin::REQUIRED_CAPABILITY, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: it's the same namespace, so \Network_Network\ is not needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Fixed in aca3096
Ah, that's true. This will depend on Automattic/newspack-plugin#3920, then, when it's merged. |
All Submissions:
Changes proposed in this Pull Request:
Adjusts caps, so the unavailable menu options are hidden for non-admins.
Dependent on Automattic/newspack-plugin#3920
How to test the changes in this Pull Request:
trunk,Other information: