Permission to edit/delete own geo entities

Created on 3 June 2025, about 1 month ago

Problem/Motivation

Currently the only permission available to edit geo entities is edit geo and like wise for deleting delete geo. These give the permission to edit any geo and delete any geo.

Proposed resolution

I propose we convert the existing permissions to edit any geo and delete any geo and then create edit own geo and delete own geo

Feature request
Status

Active

Version

1.0

Component

Code

Created by

🇮🇹Italy tanc Italy

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

Merge Requests

Comments & Activities

  • Issue created by @tanc
  • 🇮🇹Italy tanc Italy

    I've pushed the solution to the issue fork, but its been a year or so since I tried to use the gitlab integration so I'm not sure how to issue a merge request

    Does someone mind taking a look? https://git.drupalcode.org/issue/geo_entity-3528161/-/commit/7d29acd1561...

  • 🇮🇹Italy tanc Italy

    I'm not sure how to trigger the tests I added either?

  • Merge request !13feat: add 'own' permissions and test coverage → (Open) created by tanc
  • Pipeline finished with Failed
    about 1 month ago
    Total: 191s
    #513387
  • Pipeline finished with Failed
    about 1 month ago
    Total: 262s
    #513411
  • Pipeline finished with Success
    about 1 month ago
    Total: 216s
    #513430
  • Pipeline finished with Success
    about 1 month ago
    Total: 149s
    #513443
  • Pipeline finished with Success
    about 1 month ago
    Total: 178s
    #513467
  • Pipeline finished with Success
    about 1 month ago
    Total: 164s
    #513476
  • Pipeline finished with Success
    about 1 month ago
    Total: 199s
    #513488
  • Merge request !14Resolve #3528161 → (Merged) created by tanc
  • Pipeline finished with Success
    about 1 month ago
    Total: 171s
    #513489
  • 🇳🇱Netherlands ekes

    Just logging review messages:

    • Lots of nice code tidy up, the JS for sure needs it, but makes it harder to read the substantive changes. The YML for sure has inconsistent ' ".
    • Upgrade path should probably be in a post_update hook as it's working on loaded entities.
    • Does it also drop the 'administer geo' permission meaning that a user can update, delete (but leave it for create)?
  • 🇮🇹Italy tanc Italy

    Have added a new MR which should be way easier to review, sorry got carried away with the cleanup

    https://git.drupalcode.org/project/geo_entity/-/merge_requests/14/diffs#...

    It actually adds the administer geo permission which was referenced in the earlier code but not actually provided as a permission. This gives rights to do anything, whenever there is an access check run.

  • 🇳🇱Netherlands ekes

    !14 is easier to read :-) Still would be good to get that JS cleanup though.
    Administer permission I'd overlooked the early return. Makes sense.

  • Pipeline finished with Success
    about 1 month ago
    Total: 154s
    #513508
  • 🇮🇹Italy tanc Italy

    Have pushed a change with the suggested post_update hook.

    I can merge in the code cleanup later after the review of the core functionality.

  • 🇬🇧United Kingdom andybroomfield

    Just testing this with BHCC site. I'm testing MR 14.

    On default Localgov Drupal I see the permissions update.

    Before:

    After:

  • 🇬🇧United Kingdom andybroomfield

    Have tested this on BHCC site and geo entities remain editable.
    Was able to change the permission to edit and delete own and those functions where only possible on Geo entities a user was the author.
    I noticed a weird side effect which is when a geo entity that a user can view but not edit, when trying to edit in the entity browser, it removes it from the selection and switches to replace mode, instead of the opening up the editor. I guess this is intended behaviour (and from entity browser anyway).

    My only further thoughts are if we need per bundle permissions. As we now have quite a few Geo bundles (mostly for connecting and importing the data from ArcGis). So generally we would not want normal Drupal editors to have permission to delete those. Happy for that to be an advanced permission sub module.

  • 🇳🇱Netherlands ekes

    My only further thoughts are if we need per bundle permissions. As we now have quite a few Geo bundles (mostly for connecting and importing the data from ArcGis). So generally we would not want normal Drupal editors to have permission to delete those. Happy for that to be an advanced permission sub module.

    I'd that sounds reasonable, so making another issue / PR would make sense. Another suggestion (not for create so much as edit) was if the user had access to an entity referencing the geo entity... although as we don't have back references I suspect that might be too complicated.

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

Production build 0.71.5 2024