Only admins can access bookmark block

Created on 9 November 2022, over 1 year ago
Updated 5 January 2024, 6 months ago
πŸ› Bug report
Status

Needs review

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States rdworianyn

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.

  • I just installed and testing the module and got this issue too.
    I'm having this same issue and I have no such conflict with another Flag module.
    Only admin can access the block (no roles restricted).
    Flag Bookmark and Unflag Bookmark permissions are given to authenticated users.
    Same even if I give users permission to See Other's Bookmarks just to test.

  • Status changed to Needs review 7 months ago
  • πŸ‡ΊπŸ‡ΈUnited States asherry

    We're having the same issue. This block is doing its access check based on \Drupal\flag\Entity\Flag::access(). I don't know if/when things changed, but, the flag module doesn't actually seem to use the ::access() method for flagging, it seems to just use that for administration.

    Access to see if a user has the permission to do a flag action is done with the "access_check" tagged services FlagAccessCheck and UnFlagAccessCheck. It makes sense I guess, the actual places it needs to check access are primarily done in routes. These methods are calling the Flag::actionAccess method and rather than use "create" as an action, it uses "flag" and "unflag".

    I added a patch to check which action needs to be sent to ::actionAccess and then returned that for ::blockAcces.

  • πŸ‡ΊπŸ‡ΈUnited States asherry

    Fixed two major issues with the last patch.
    - Before auto alias creation we need to check if the current page is 404. (this might need more work)
    - Check to see if there is an existing alias in the current language, OR in language unspecified.

Production build 0.69.0 2024