Problem/Motivation

There is a new grant permissions method, we should update UserCreationTrait::grantPermissions() to use that.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Issue fork drupal-3621087

Command icon Show commands

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

nicxvan created an issue. See original summary.

amateescu’s picture

Title: [pp-1] update UserCreationTrait::grantPermissions() to use new RoleInterface::grantPermission. » Update UserCreationTrait::grantPermissions() to use new RoleInterface::grantPermissions
Issue summary: View changes
berdir’s picture

Maybe 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.

danielveza made their first commit to this issue’s fork.

danielveza’s picture

Yeah 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.

danielveza’s picture

Status: Active » Needs review

Had 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.

smustgrave’s picture

Is 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.