Problem/Motivation

I have a single view which is used for both editors and read-only users.
For read-only users, I'd like to show the field value even when they do not have access to edit.

However, the module does not currently support this. Instead, nothing is shown at all.

Proposed resolution

Add a fallback view to render the field when edit access is not available.

This PR implements this as a simple view-mode selector, rather than expose all the field settings.

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

aaronbauman created an issue. See original summary.

aaronbauman’s picture

Status: Active » Needs review
anybody’s picture

Title: Feature request: fallback view when user does not have edit access » Show the field value (by view mode) instead of the field if a user does not have edit access
Status: Needs review » Needs work

@aaronbauman thanks! Nice idea!!

I left some comments on the MR and it will need a rebase. Please note that this will also need a schema entry once #3559313: Define configuration schema is merged.

aaronbauman’s picture

Status: Needs work » Needs review

Thank you for the feedback.
I think i addressed both those concerns.

phpstan and phpcs are failing upstream, but otherwise i think MR is back to NR

anybody’s picture

Status: Needs review » Needs work

Thanks @aaronbauman. LGTM, but please remove the unrelated .gitlab-ci.yml here. This should go into the dedicated issue.

aaronbauman’s picture

are we looking at the same thing?
there is no change to gitlab-ci in this MR, only a merge from 8.x-1.x

anybody’s picture

Status: Needs work » Reviewed & tested by the community

@aaronbauman sorry - that's indeed misleading and I didn't know: I clicked the "Compare with previous version" link above below comment #4: https://git.drupalcode.org/project/views_entity_form_field/-/merge_reque...

And that included the .gitlab-ci.yml change - I guess because of the rebase!

Sorry! RTBC from my side, if maintainers are fine with this feature!

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

vladimiraus’s picture

Status: Reviewed & tested by the community » Fixed

Thank you everyone for your contributions.
Committed. 🍻

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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