Move hasRole() method from UserInterface to AccountInterface

Created on 15 August 2021, about 4 years ago
Updated 5 March 2024, over 1 year ago

Problem/Motivation

In 📌 Add hasRole() method to AccountProxy and UserSession classes Fixed we added hasRole() implementation to AccountProxy.php and UserSession.php classes. The AccountInterface remained unchanged to keep it compatible with existing contrib and custom AccountInterface implementations.

Proposed resolution

Move method hasRole() definition to AccountInterface.

Remaining tasks

  1. Wait for 📌 Add hasRole() method to AccountProxy and UserSession classes Fixed to land
  2. : https://www.drupal.org/node/3283218
  3. Make sure all tests are still happy
  4. Reviews / refinements
  5. RTBC

API changes

AccountInterface has been extended with a new method - AccountInterface::hasRole().

📌 Task
Status

Active

Version

11.0 🔥

Component
User system 

Last updated 20 days ago

Created by

🇺🇦Ukraine Matroskeen 🇺🇦 Ukraine, Lutsk

Live updates comments and jobs are added and updated live.
  • Needs release manager review

    It is used to alert the release manager core committer(s) that an issue significantly affects the overall technical debt or release timeline of Drupal, and their signoff is needed. See the governance policy draft for more information.

Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • First commit to issue fork.
  • Pipeline finished with Failed
    over 1 year ago
    Total: 196s
    #112263
  • Status changed to Needs review over 1 year ago
  • 🇳🇿New Zealand RoSk0 Wellington

    Just stumbled across a TODO pointing to this issue in the core.

    I'm not in the position to judge about the big picture consequences following from this change, but to me it looks logical and brings consistency.

    Rebased original code to the 11.x, removed TODO's from where they were referring to this issue, updated method signatures where necessary. Code style checked - no new violations added.

    Will see what test results would look like.

  • 🇳🇿New Zealand RoSk0 Wellington

    Had to create new branch and a merge request as it's impossible (at least for me) to change existing merge request target.

    New MR is https://git.drupalcode.org/project/drupal/-/merge_requests/6931

  • Pipeline finished with Success
    over 1 year ago
    Total: 665s
    #112267
  • 🇫🇷France andypost

    @Berdir re #17 maybe easier to move UserInterface to core and get rid of AccountInterface?

  • 🇺🇸United States smustgrave

    smustgrave changed the visibility of the branch 3228209-add-accountinterface-hasrole to hidden.

  • 🇺🇸United States nicxvan

    Tests are still passing, @andypost, do you have specific objections to this?

    From a developer perspective this is really nice for consistency.

  • Status changed to RTBC over 1 year ago
  • 🇺🇸United States smustgrave

    Asked about this in #needs-review-queue-initative and @xjm mentioned can move this to RTBC if feel this is ready and just missing release manager sign off.

    Haven't seen a follow up to #26 so looking at just the MR I do not see any issue with the move. Typehints appears good too.

  • Status changed to Needs work over 1 year ago
  • The Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".

    This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.

    Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

  • Pipeline finished with Failed
    5 months ago
    #465817
  • Pipeline finished with Success
    5 months ago
    #465834
  • First commit to issue fork.
  • Pipeline finished with Failed
    3 months ago
    Total: 970s
    #515306
  • Status changed to RTBC 23 days ago
  • 🇮🇹Italy apaderno Brescia, 🇮🇹

    I am setting back the status set by comment #27.

Production build 0.71.5 2024