Integrate Permissions by Term with ECA

Created on 29 August 2023, 10 months ago
Updated 20 March 2024, 3 months ago

Problem/Motivation

Would it be possible to create compatibility with this module Permissions by Term β†’ so with ECA would be possible to add current user if he meets conditions to "allowed users" list automatically on selected term.

Thank you

✨ Feature request
Status

Active

Version

3.1

Component

Code

Created by

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

Comments & Activities

  • Issue created by @coaston
  • πŸ‡©πŸ‡ͺGermany jurgenhaas Gottmadingen

    I have changed the title from "compatibility" to "integration", since the 2 modules are not incompatible with each other. But they may be benefitting from some integration. I've also moved this to the "Permissions by Term" module to see, if the integration can be done here. ECA won't integrate with any non-core module. If it can't be done here, it would require a new contrib module just for the integration.

    Since I'm not an expert in the "Permissions by term", I don't know what would be the required feature set. Is there an action plugin here, which would do the assignment of a user to ... (whatever is needed here)?

  • Hi,

    Thank you, makes sense.

    "Permissions by Term" module uses terms to access the node. Simply, term has ability to add users (one by one, comma separated) and this users can access node which as reference to it.

    Everything works fine, however the problem is that there has to be some owner which will add users one by one to that specific term, like company, or organization, team etc.

    I know that with ECA there is possibility to add values/users to multivalue field so in case that user has the same organization selected in his profile and using Views and ECA it is easy to add such users to that term very easily. However this module does not have separated field which will be visible in ECA.

    Meanwhile I was able to achieve my goal with a different approach using following modules : access_by_ref β†’ witch combination of node_view_permissions β†’ . I believe that with following ECA model eca_feature_demo I will be able to automatize it based on email as described in your model. However this is just a workaround.

    Thank you for your clafirication. I had no clue about

    ECA won't integrate with any non-core module
  • πŸ‡©πŸ‡ͺGermany jurgenhaas Gottmadingen

    Thank you for your clafirication. I had no clue about

    ECA won't integrate with any non-core module

    Don't get me wrong, we're happy to integrate with everything in the Drupalverse. My statement was just about the main ECA module, which has no dependency other than Drupal core on purpose. Integrations either happen in the module that needs to be integrated, e.g. Permissions by Term, or in a dedicated integration module which could be eca_permissions_by_term in this case.

    As for that integration, it seems to require an action plugin, which does the work to add a user to a taxonomy term. However, if that assignment were done through an entity reference field, then no extra action plugin would be required because existing action plugins from the ECA Content module could be used to do that. I can't justify what's required since I'm not familiar with Permission by Term.

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

    I am trying to use these 2 modules at the same time as well.

    My goal is to use Permissions by Term's 'permission mode' for all but 1 content type.

    I tried using ECA to force 'allowed' for this one content type but it cant seem to override the PbT setting. Is there a way to make ECA run AFTER PbT?

  • πŸ‡©πŸ‡ͺGermany jurgenhaas Gottmadingen

    Hooks are dispatched by module weight and after that in alphabetic order. The alphabetic order cannot be changed, the module weight could be, but I'm sure that causes trouble elsewhere.

    If it were about events, though, then the event subscriber can define a weight so that you have fine-grained control over the sequence in which the subscribers get called.

    I don't know PbT on how it works, so I'm not sure how the integration would have to be done.

Production build 0.69.0 2024