Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Let's start to convert all calls to user_access() with the new AccountInterface::hasPermission() method.
Part of #2048171: [meta] Replace user_access() calls with $account->hasPermission() wherever possible.
Change records for this issue:
Comment | File | Size | Author |
---|---|---|---|
#8 | drupal-forum_replace_user_access-2061997-9.patch | 2.17 KB | InternetDevels |
#6 | drupal-forum_replace_user_access-2061997-6.patch | 590 bytes | InternetDevels |
#1 | drupal-forum_replace_user_access-2061997.patch | 615 bytes | InternetDevels |
Comments
Comment #1
InternetDevels CreditAttribution: InternetDevels commentedHere is the patch.
Comment #2
larowlanI think the dx of this needs work
Comment #3
larowlanWe should be injecting the Request into the block plugin here. See https://drupal.org/node/2012118.
Comment #4
andypostUse Drupal::currentUser() service https://drupal.org/node/2032447
or probably #2048223: Add $account argument to AccessCheckInterface::access() method and use the current_user service
Comment #5
larowlanLets get #1951268: Convert /forum and /forum/% to new router, remove forum_forum_load(), forum_get_topics(), create Forum service in first (which has been reviewed by @catch, @alexpott, @tim.plunkett, @jibran and @dawehner so must be close)
Comment #6
InternetDevels CreditAttribution: InternetDevels commentedAs issue from comment above is resolved new patch attached.
Comment #7
andypostSuppose this require new issue to pass $account to access method of blockBase, at least this require proper service injection
Comment #8
InternetDevels CreditAttribution: InternetDevels commentedcorrected
Comment #9
areke CreditAttribution: areke commentedThe patch doesn't apply, and needs to be re-rolled.
Comment #10
slimbk CreditAttribution: slimbk commentedComment #11
andypostAlready fixed