Use a custom node access operation to allow implementations of hook_node_access() to define custom access rules

Created on 17 February 2023, over 1 year ago
Updated 21 February 2024, 9 months ago

Problem/Motivation

Access for the quick_node_clone.node.quick_clone route and the entity operation is currently implemented using a custom function _quick_node_clone_has_clone_permission. It is currently not easy to implement custom access rules, and code in hook_node_access() does not allow changing access for the route and operation.

Proposed resolution

Use a custom operation to check access for the quick_node_clone.node.quick_clone route and the entity operation.

$node->access('clone')

Remaining tasks

User interface changes

None

API changes

The quick_node_clone module will now allow access to be altered via hook_node_access implementations.

Data model changes

None

Feature request
Status

Needs work

Version

1.0

Component

Code

Created by

🇳🇱Netherlands seanB Netherlands

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

Merge Requests

Comments & Activities

  • Issue created by @seanB
  • Status changed to Needs review over 1 year ago
  • 🇳🇱Netherlands seanB Netherlands

    Attached is a patch that should fix this.

  • 🇺🇸United States joegraduate Arizona, USA

    We've tested this patch and found that it fixes issues we encountered when using Quick Node Clone together with the Workbench Access module.

  • 🇺🇸United States joegraduate Arizona, USA

    Re-rolled #2 against latest 8.x-1.x branch.

  • Status changed to Needs work 10 months ago
  • 🇺🇸United States markdorison

    Please update the merge request so that GitLabCI tests will run against it. Thank you!

  • First commit to issue fork.
  • Pipeline finished with Failed
    9 months ago
    Total: 171s
    #95172
  • Pipeline finished with Failed
    9 months ago
    Total: 166s
    #95204
  • Pipeline finished with Failed
    9 months ago
    Total: 165s
    #95206
  • Pipeline finished with Failed
    9 months ago
    Total: 272s
    #95215
  • Pipeline finished with Failed
    9 months ago
    Total: 189s
    #95221
  • Pipeline finished with Canceled
    9 months ago
    #95231
  • Pipeline finished with Failed
    9 months ago
    #95232
  • Pipeline finished with Failed
    9 months ago
    Total: 262s
    #95235
  • Pipeline finished with Failed
    9 months ago
    Total: 216s
    #95245
  • Pipeline finished with Failed
    9 months ago
    Total: 183s
    #95265
  • Pipeline finished with Failed
    9 months ago
    Total: 247s
    #95283
  • Pipeline finished with Failed
    9 months ago
    Total: 184s
    #95286
  • Pipeline finished with Failed
    9 months ago
    Total: 246s
    #95290
  • Pipeline finished with Failed
    9 months ago
    Total: 300s
    #95312
  • Pipeline finished with Failed
    9 months ago
    Total: 181s
    #95352
  • Pipeline finished with Failed
    9 months ago
    Total: 210s
    #95359
  • Pipeline finished with Failed
    9 months ago
    Total: 246s
    #95376
  • 🇺🇸United States trackleft2 Tucson, AZ 🇺🇸

    Re-rolled #5 against latest 8.x-1.x branch.
    Updated the Merge Request

  • Pipeline finished with Failed
    9 months ago
    Total: 183s
    #95381
  • Pipeline finished with Failed
    9 months ago
    Total: 213s
    #95446
  • Pipeline finished with Success
    9 months ago
    Total: 339s
    #95449
  • 🇺🇸United States trackleft2 Tucson, AZ 🇺🇸

    Updated the merge request again, now all tests pass.

  • Status changed to Needs review 9 months ago
  • 🇺🇸United States trackleft2 Tucson, AZ 🇺🇸
  • 🇮🇳India __i.am.prashant__

    I reviewed the changes done in the quick_node_clone module looks fine and useful for community it makes ease of use. Improving ease of use is always a priority, and it's rewarding to see these enhancements making a positive impact. Thank you

  • Pipeline finished with Success
    9 months ago
    Total: 214s
    #95929
  • 🇺🇸United States trackleft2 Tucson, AZ 🇺🇸

    I've updated the merge request again with only a minor adjustment.

    Uploading a new patch with this change.

  • Status changed to Needs work 9 months ago
  • 🇺🇸United States trackleft2 Tucson, AZ 🇺🇸

    This still needs work, workbench access does not yet work.

Production build 0.71.5 2024