Needs review
Project:
Drupal core
Version:
main
Component:
user.module
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
6 Sep 2026 at 00:25 UTC
Updated:
5 Oct 2026 at 22:36 UTC
Jump to comment: Most recent
There is a new grant permissions method, we should update UserCreationTrait::grantPermissions() to use that.
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
amateescu commentedComment #3
berdirMaybe we should deprecate that directly instead of updating it, it's a one-liner then and the caller still has to load the role correctly, we can't fix the loadOverrideFree problem within this method, this doesn't really make it shorter anymore. Would be slightly different if we'd pass an ID, but we don't.
Comment #5
danielvezaYeah I agree with @berdir on this one. The only arguement I could see against it would be that it's used a bit in contrib, but the replacement is pretty easy to implement.
I'll work on this one today/tomorrow.
Comment #7
danielvezaHad a crack at this, will need a CR and the node ID changed in the PR. Just wanted to get approval on the deprecation before bothering.
Comment #8
smustgrave commentedIs this something we really want to do? What's the pro?
May just be me but think UX of just calling " $this->grantPermissions(Role::load(Role::AUTHENTICATED_ID), ['use editorial transition publish'])" is cleaner/easier then the alternative.