Problem/Motivation

Some popular contrib modules (e.g. webform) provide views without permission checks.
There is a request to add access checks to webform but the discussion in #2499029: Add Default Views access control is not finished (last comment two years ago).
So I think a possibility to whitelist whole views or view displays would be quite nice.
There is a similiar issue #2687099: Webform 4 default Views triggering Views access warning for the 7.x branch with a patch but I think for 3.0.x we should use the setting mechanism already provide by security review.

Other modules providing views without access check are commerce and profile (see #3259261: Missing Views access restrictions according to Security Review module)

Steps to reproduce

Enable webform and security review's "Views access" check. Run the check and you'll get a failure "Webform submissions: default".

Proposed resolution

Remaining tasks

None.

User interface changes

None.

API changes

None.

Data model changes

No real data model changes but new config settings for ignores.

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

gngn created an issue. See original summary.

gngn’s picture

Issue summary: View changes
Status: Active » Needs review
StatusFileSize
new2.69 KB

Patch as proposed above.

smustgrave’s picture

smustgrave’s picture

Status: Postponed » Closed (outdated)

Closing as outdated. If still an issue please test on 2.x branch and reopen please

Thanks!

gngn’s picture

I reopen this for 3.0.x because it is still an issue, I do not think the other modules are going to provide access checks and I really like to have a clean security review ;)

The patch is a bit smaller than the one provided for 8.x in #2 (mainly because we already have config for the views access check).
Like #2 you can enter whole views or distinct displays to ignore (i.e. "webform_submissions" or "webform_submissions:embed_default").

I also updated the description.

smustgrave’s picture

Status: Needs review » Needs work

Will have to think about adding this one but fixes should be in MRs

gngn’s picture

Status: Needs work » Needs review

I created a MR.
hope everything went OK (I'm still not used to MRs).

smustgrave’s picture

Status: Needs review » Needs work

Will need to update schema + update hook.

smustgrave’s picture

Version: 3.0.x-dev » 3.1.x-dev
Assigned: Unassigned » smustgrave

Finally have test coverage for this plugin so we can land this feature.

smustgrave changed the visibility of the branch 3216263-whitelist-views to hidden.

smustgrave’s picture

Status: Needs work » Needs review

smustgrave’s picture

Status: Needs review » Fixed

Want to try out on latest 3.1.x

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.