Make WordPress Core

Opened 5 years ago

Last modified 3 weeks ago

#45197 reviewing enhancement

Introduce `user_can_for_blog()`

Reported by: johnbillion's profile johnbillion Owned by: johnbillion's profile johnbillion
Milestone: 6.6 Priority: normal
Severity: normal Version:
Component: Role/Capability Keywords: needs-unit-tests has-patch
Focuses: multisite Cc:

Description

The available user capability checking functions include:

  • current_user_can()
  • user_can()
  • current_user_can_for_blog()

What's missing is user_can_for_blog() so that both a user ID and a site ID can be passed in order to check a given user's capabilities on a given site.

Attachments (1)

45197.diff (1.1 KB) - added by tmanoilov 5 years ago.

Download all attachments as: .zip

Change History (4)

#1 @johnjamesjacoby
5 years ago

+1 to this.

I have coded some version of this logic at least a few times (into private methods in plugins.)

I can adapt something into a patch, but it’s pretty straight forward if anyone wants to try.

Last edited 5 years ago by johnjamesjacoby (previous) (diff)

@tmanoilov
5 years ago

#2 @tmanoilov
5 years ago

  • Keywords has-patch added; needs-patch removed

Hey guys, I'm at WordCamp Sofia 2018 Contributors day and this is the first patch I'm submitting. I'm not able to fully test it so I'm looking forward to a review. Thanks in advance.

#3 @johnbillion
3 weeks ago

  • Milestone changed from Future Release to 6.6
  • Owner set to johnbillion
  • Status changed from new to reviewing
Note: See TracTickets for help on using tickets.