hook_install add a permission that does not exist

Created on 26 March 2021, over 3 years ago
Updated 21 March 2023, over 1 year ago

Problem/Motivation

The "access pwa" permission does not exist. But hook_install set it on anonymous users.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇫🇷France Grimreaper France 🇫🇷

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

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

  • 🇬🇧United Kingdom khaled.zaidan

    Yeah, I just spotted this issue now, as well.

    I think it's worth implementing hook_update_N() to remove the permission with the next release.

    Code is simple (I just haven't yet gotten the hang of GitLab :( ).

    /**
     * Remove the non-existent 'access pwa' permission from the anonymous user role.
     */
    function pwa_update_8002() {
      user_role_revoke_permissions(RoleInterface::ANONYMOUS_ID, ['access pwa']);
    }
    
  • Status changed to Needs work over 1 year ago
  • 🇩🇪Germany Anybody Porta Westfalica

    @khaled.zaidan could you test that please and add the code to the MR?

  • Status changed to Fixed over 1 year ago
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024