Comments

tim.plunkett created an issue. See original summary.

tim.plunkett’s picture

Status: Active » Needs review
StatusFileSize
new2.84 KB
eclipsegc’s picture

Status: Needs review » Needs work

So my first response here is to ask for a permission autocomplete for the configuration field. I can't see how someone would successfully use this without something along these lines.

Eclipse

tim.plunkett’s picture

Status: Needs work » Needs review
Issue tags: +Needs tests
StatusFileSize
new8.44 KB
new6.74 KB

This needs web tests.

Status: Needs review » Needs work

The last submitted patch, 4: 2665692-ctools-4.patch, failed testing.

tim.plunkett’s picture

Status: Needs work » Needs review
Issue tags: -Needs tests
StatusFileSize
new10 KB
new6.74 KB

Added a browser test instead!

rjg’s picture

This issue is still around 2 years later, and I've found that this functionality would be desirable across all modules, including core ones like block (for block visibility).

I created a new module to add this functionality, inspired by the patches here, hoping that it will end up in core. Source is at: https://github.com/rjgwiz/user_permission_condition

manuel.adan’s picture

IMHO, it is preferable to work on the ctools patch rather than create a new module for this. It appears to be an old issue, not sure if exists an alternative way to have conditional access by permissions. It is a basic feature working with page_manager.

manuel.adan’s picture

Issue tags: +Needs tests
StatusFileSize
new5.2 KB
new10.82 KB

I made a mix of #6 and the proposed module by @rjg:

  • as in the module, autocomplete permission selector was replaced by a select field type in configuration form, as core views does
  • adds the empty value for no restriction

Some tests needed.

manuel.adan’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new5.22 KB
new429 bytes

Updated patch to accommodate changes introduced at #3014949: Deprecate 'context' on Block and Condition plugin annotations in favor of 'context_definitions'.

In the meantime, @geek-merlin published the User Permission Condition module that is almost a copy of this patch. The module is marked as stable.

I've been using this patch in some projects without issues until they were recently updated to D9. Patch is actually being tested at the mentioned module, so I think it can be marked as RTBC for that reason and also to gain attention from maintainers to finally decide about adding this condition plugin into the Chaos Tools or not.

japerry’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new6.4 KB

Made a few changes based on the other contrib module. We should add this to ctools, pretty sure tests will pass since this doesn't have any meaningful tests with it.