Make WordPress Core

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#9339 closed defect (bug) (invalid)

Use default role when none is set

Reported by: Denis-de-Bernardy Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.7
Component: Users Keywords: has-patch tested commit
Focuses: Cc:


While playing with BBPress and trying to make it integrate with WP, I ran into a bug.

Basically, user registers through BBPress, then tries to log into WP, and gets an error in the dashboard: Not enough permissions.

Reason is obvious: he has no role defined. Only after logging into BB does his role get set. That's fine in some cases, but not always. For instance, I've two sites that share the database's users table, and I'd like to have different roles for newly created users on the two sites (in the members' area site, they're subscribers; on the other site they're contributors).

The expected behavior would be for WP to check, whenever a user logs in, whether that user has a role. And, if that users has no role, he should be assigned the default role.

Attachments (1)

9339.diff (504 bytes) - added by Denis-de-Bernardy 5 years ago.
against 11256

Download all attachments as: .zip

Change History (7)

comment:1 Denis-de-Bernardy5 years ago

  • Keywords has-patch needs-testing added

comment:2 Denis-de-Bernardy5 years ago

  • Keywords tested added; needs-testing removed

comment:3 Denis-de-Bernardy5 years ago

  • Milestone changed from 2.7.2 to 2.8

comment:4 Denis-de-Bernardy5 years ago

  • Keywords commit added

commit? wontfix?

Denis-de-Bernardy5 years ago

against 11256

comment:5 westi5 years ago

  • Milestone 2.8 deleted
  • Resolution set to invalid
  • Status changed from new to closed

Not convinced by this.

What happens if the WP site have user-registration disabled (which is the default).

I think the role creation in this case should happen at the bbPress end when the user is registered probably using a bbPress plugin to get this behaviour.

comment:6 Denis-de-Bernardy5 years ago

in this case, they don't share the users' table... I'm only partially agreeing with your closing this. It's BB-related and may be better fixed with a plugin, but there is a genuine issue in the core also. Users should always have at least one role imo.



Note: See TracTickets for help on using tickets.