WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 8 weeks ago

#14479 closed enhancement (wontfix)

Add filter hook to 'is_super_admin()' function

Reported by: benward Owned by: benward
Milestone: Priority: normal
Severity: normal Version: 3.0
Component: Role/Capability Keywords: has-patch
Focuses: Cc:

Description

This patch adds a new filter, named 'is_super_admin' to the end of the capabilities.php:is_super_admin() function, allowing plugins to override the result of this capabilities check.

Use cases:

  • Applying/restricting Super Admin privilege based on an external user authentication/permissions system.
  • Restricting Super Admin privilege based on a user's network location.

Attachments (1)

capabilities-super_user_filter.diff (901 bytes) - added by benward 4 years ago.
Adds 'is_super_user' filter to 'is_super_user()' function.

Download all attachments as: .zip

Change History (5)

benward4 years ago

Adds 'is_super_user' filter to 'is_super_user()' function.

comment:1 benward4 years ago

  • Keywords has-patch added; capabilities is_super_admin fiters removed

comment:2 nacin3 years ago

  • Milestone changed from Awaiting Review to Future Release

comment:3 mordauk8 weeks ago

I'm not confident we should be giving plugins the power to do that so easily. Right now if a plugin wanted to give a user super admin rights, it could use the grant_super_admin() function.

I'd rather plugins be required to promote a user to a super admin instead of allowing them to simply filter the is_super_admin check.

comment:4 nacin8 weeks ago

  • Milestone Future Release deleted
  • Resolution set to wontfix
  • Status changed from new to closed

Yeah, I agree. We should also work toward making more is_super_admin() calls capability checks instead.

Note: See TracTickets for help on using tickets.