Problem/Motivation

Currently when there is no value set on an entity, workbench access allows access:

 // If no value is set on the entity, ignore.
// @TODO: Is this the correct logic? It is helpful for new installs.
      if (empty($entity_sections)) {
        return AccessResult::neutral();
      }

When configuring on an existing site, it is impractical to put all existing content into a section.

Proposed resolution

I can see an application for this behavior on a new site, so I suggest making this a configuration option.

Comments

ZenDoodles created an issue. See original summary.

ZenDoodles’s picture

Issue summary: View changes
agentrickard’s picture

Status: Active » Needs review
StatusFileSize
new3.57 KB
new42.9 KB

Here's a patch that adds a new setting 'Deny access to unassigned content'.

Right now it defaults to 'off', which is the current behavior. We're in alpha, so it could be changed to 'on.'

This still needs a test, but the patch is ready for manual testing.

There is an update hook due to a settings schema change.

agentrickard’s picture

StatusFileSize
new8.63 KB

And a new patch with Unit tests (!).

agentrickard’s picture

The only question left here is "should this behavior be turned on by default"?

I deliberately didn't do that because it is a behavior change from the current alpha.

agentrickard’s picture

StatusFileSize
new19.93 KB

It's the deprecated function calls throwing exceptions....

larowlan’s picture

Status: Needs review » Reviewed & tested by the community

Looks good

agentrickard’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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