Currently restrictions are available only as high up as layouts. Allow restrictions based on field name and content type as well.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

sethhill created an issue. See original summary.

sethhill’s picture

This MR adds some additional contexts that can be evaluated against:
field_name: the Paragraphs reference field
entity_type: the entity type (node, taxonomy term, etc.)
entity_bundle: the entity bundle (content type, etc.)

It also modifies the application of restrictions such that all contexts are required to match in order for any restriction to apply. This allows setting granular or broad restrictions, depending on the combination.

For example:

field_rule:
  context:
    entity_type: node
    entity_bundle: me_test_ct
    field_name: field_me_test_content
    region: _root
  components:
    - me_test_container

Will only match on the root level of the field_me_test_content field when it is on a node of type me_test_ct. All other instances of that field will not be restricted.

sethhill’s picture

Status: Active » Needs review

justin2pin made their first commit to this issue’s fork.

  • sethhill committed 0b9548e2 on 2.1.x
    Issue #3500389: Allow restrictions based on content type or field name
    
sethhill’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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