Skip to content
This repository has been archived by the owner on Jan 13, 2022. It is now read-only.

Add permission check #40

Merged
merged 3 commits into from
Jan 10, 2020
Merged

Add permission check #40

merged 3 commits into from
Jan 10, 2020

Conversation

spacedmonkey
Copy link
Collaborator

@spacedmonkey spacedmonkey commented Jan 8, 2020

Add some basic checks (with tests) to check that current user has access to edit a menu / menu item before they can access the object. This means that the menu / menu items will not be public. As a menu might have sensitive data in it, let's make it private for now.

Fixes #26

@spacedmonkey
Copy link
Collaborator Author

Looping in @getdave , as this may affect work done on WordPress/gutenberg#18869

Copy link
Member

@TimothyBJacobs TimothyBJacobs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor tweaks.

lib/class-wp-rest-menu-items-controller.php Outdated Show resolved Hide resolved
lib/class-wp-rest-menus-controller.php Show resolved Hide resolved
tests/test-rest-nav-menu-items-controller.php Show resolved Hide resolved
@TimothyBJacobs TimothyBJacobs self-requested a review January 9, 2020 18:09
Copy link
Member

@TimothyBJacobs TimothyBJacobs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Navigation permissions
3 participants