Add permissions to view prev/next links

Created on 1 November 2023, about 1 year ago
Updated 25 January 2024, 10 months ago

Currently, all users have access to prev/next links. We need to create a new permission to show it only for particular roles.

🐛 Bug report
Status

Fixed

Version

3.0

Component

Code

Created by

🇺🇦Ukraine AstonVictor

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

Merge Requests

Comments & Activities

  • Issue created by @AstonVictor
  • Merge request !103398281 - Add permission to view links → (Merged) created by AstonVictor
  • Issue was unassigned.
  • Status changed to Needs review about 1 year ago
  • 🇺🇦Ukraine AstonVictor

    Created a new PR.
    Added a new permission to view Prev/next links.

    Note that it is disabled by default. I guess we can add an update hook to enable it for Anonymous & Authenticated users.

  • Status changed to Needs work about 1 year ago
  • 🇮🇹Italy aronne

    Hi @AstonVictor,
    I'm ok with adding a new permission to access prev next links but it can't be a default behavior or nobody will get to see them leading people to think the module is not working properly.

    I would rather make it configurable so that only if an "admin" chooses to enable that feature then the permission check will be executed.

    Regards,
    aronne

  • 🇮🇳India mukhtarm

    @aronne thats correct. I also think creating a new configurable permission, that can be assigned to a role by an administrative role user.

  • @mukhtarm opened merge request.
  • Status changed to Needs review about 1 year ago
  • 🇺🇦Ukraine AstonVictor

    Updated my MR.
    Added a new config on the settings page to enable/disable the access by permission.

    Hi @MukhtarM,
    I saw your MR and there are a lot of incorrect things. e.g. your permission is not on the permission page, some of the strings are now wrapped with the t() function, and other strings are using t() instead of $this->t(), there are code standard issues, the select field is not the best way for fields with multiple choices, etc.

  • 🇮🇳India mukhtarm

    hi @AstonVictor the translation string can be corrected, and i couldn't see any error if by default i am not selecting any permission or roles assigned to it (If that is meant by validation returns FALSE if the admin doesn't add configurations on the settings page.).

    yea didn't added the new permission but thought to manage in the configuration form itself (Not sure about this).

    But your way works too 👍. rather than these this workflow need to be confirmed to be correct by @aronne. Thanks

  • Assigned to AstonVictor
  • Status changed to Needs work about 1 year ago
  • 🇺🇦Ukraine AstonVictor

    Note that we should update the MR because we merged the schema for the config. So, we should update the schema by including new configurations.

  • Issue was unassigned.
  • Status changed to Needs review about 1 year ago
  • 🇺🇦Ukraine AstonVictor

    Updated the MR by updating schema config.

  • Status changed to Needs work about 1 year ago
  • Status changed to Needs review about 1 year ago
  • Assigned to AstonVictor
  • Status changed to Needs work 10 months ago
  • 🇮🇹Italy aronne

    Hi @AstonVictor,
    I merged your MR against 2.0.x
    Please open a new MR for the 3.0.x branch as well so that we can close this issue.

    Thank you and kind regards,
    aronne.

  • Status changed to Fixed 10 months ago
  • 🇺🇦Ukraine AstonVictor

    Hi @aronne,

    Actually, the 3.0.x version already has a permission check - https://git.drupalcode.org/project/prevnext/-/blob/3.0.x/prevnext.module...

    and it has both global permission and entity type permission.

  • 🇮🇹Italy aronne

    ok perfect thanks again @AstonVictor.

  • Issue was unassigned.
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024