Skip to content
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

Update: Replace site.user_can_manage with site.capabilities && site.capabilities.manage_options #3970

Merged
merged 1 commit into from
Mar 14, 2016

Conversation

enejb
Copy link
Member

@enejb enejb commented Mar 11, 2016

We are planning to remove user_can_manage from the endpoint.

To test:
??
Run the API test. Browse though the the admin and try to see if anything is broken.

cc: @lezama and @mtias

@enejb enejb added API [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. [Type] Janitorial labels Mar 11, 2016
@mtias
Copy link
Member

mtias commented Mar 11, 2016

Nice, thanks for this. I'll let @lezama give it a go ;)

@lezama
Copy link
Contributor

lezama commented Mar 11, 2016

Thanks Enej! 👍

We could use the userCan helper( https://github.com/Automattic/wp-calypso/blob/master/client/lib/site/utils.js#L7 ) in order to avoid all those site.capabilities && site.capabilities.manage_options

@lezama lezama added [Status] Needs Author Reply and removed [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Mar 11, 2016
@mtias
Copy link
Member

mtias commented Mar 11, 2016

We could use the userCan

Good call.

@enejb enejb added [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. and removed [Status] Needs Author Reply labels Mar 11, 2016
@enejb
Copy link
Member Author

enejb commented Mar 11, 2016

Just updated the code to use userCan. Thanks for the suggestion!

@lezama
Copy link
Contributor

lezama commented Mar 12, 2016

LGTM after rebase 👍

@lezama lezama added [Status] Ready to Merge and removed [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Mar 12, 2016
…apabilities.manage_options

We are planning to remove user_can_manage from the endpoint.
@enejb enejb force-pushed the remove/user_can_manage branch from ea32f17 to 55bc973 Compare March 14, 2016 16:19
enejb added a commit that referenced this pull request Mar 14, 2016
Update: Replace site.user_can_manage with utils.userCan( 'manage_options' );
@enejb enejb merged commit 5f199c5 into master Mar 14, 2016
@enejb enejb deleted the remove/user_can_manage branch March 14, 2016 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants