I find it counter-intuitive that view_unpublished "takes away" the ability of a role user to view and edit their own unpublished content.

Shouldn't this be more in additon to what is allowed by core? So that you can have editorial roles that don't need administrator rights.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

laken’s picture

Title: Removes permission to edit/view own unpublished content » Fails to respect core 'view own unpublished content' permission
Category: feature » bug
FileSize
1.11 KB

We confirm that when this module is enabled, it overrides core's 'view own unpublished content' permission. I changed status to bug because it seems to me that this breaks core in that respect.

Attached patch checks that core permission and sets up grants to replicate it.

laken’s picture

Version: 7.x-1.1 » 7.x-1.x-dev
lotyrin’s picture

Status: Active » Needs review

Encountered this. Updating status now that there's a patch.

Hopefully I'll have a chance to review soon.

Anonymous’s picture

Just tried this patch. Works like a charm. Thanks!

jherencia’s picture

Status: Needs review » Reviewed & tested by the community

It works for me too.

rv0’s picture

#1
Works fine for me too! Thank you very much

Valera Tumash’s picture

It works for me as well. Just module disable/enable was needed.

DRippstein’s picture

Patch worked like a charm. Hope to see this committed soon.

daniel.nitsche’s picture

Works for me, however I have to rebuild permissions anytime a new node is added, otherwise the same problem applies. Anyone else having this problem?

DRippstein’s picture

Odd. And no, I haven't experienced that myself.

SophieG’s picture

Is this patch has been committed yet ?

tanmayk’s picture

+1 for RTBC

Jason Dean’s picture

Worked great for me. As mentioned in #7, I had to disable and enable the module again, then rebuild permissions.

Les Lim’s picture

Priority: Normal » Critical
Issue summary: View changes

Patch in #1 looks good. Elevating this to Critical, as it renders part of a core permission unusable. ("Critical" is borderline, but it's definitely at least "Major".)

quotesBro’s picture

#1 works good.

jgullstr’s picture

#1 Confirmed.

bkosborne’s picture

Status: Reviewed & tested by the community » Needs work

People are mentioning that they needed to rebuild node access permissions to get this working. We should probably include an update hook in this patch to trigger a user to rebuild permissions.

bkosborne’s picture

Status: Needs work » Needs review
FileSize
1.71 KB
bkosborne’s picture

tierso’s picture

(wrong thread, ignore)

  • Commit dce93a4 on 7.x-1.x authored by laken, committed by entendu:
    Issue #1762904 by laken, bkosborne, miiimooo: Fails to respect core '...
entendu’s picture

Status: Needs review » Closed (fixed)

Looks good. Thank you.

treksler’s picture

any reason the install file update hook couldn't simply call node_access_rebuild(); instead of node_access_needs_rebuild(TRUE);

it is super annoying UX to have code, which is capable of detecting that something needs to be done, bug the user to actually do it.

bkosborne’s picture

Because that operation could potentially take a really look time if there are thousands or tens of thousands of nodes on a site. I think in such a case, a maintainer of a site like that would rather rebuild the node access permissions when they want (even if that may be right after they update the module).

treksler’s picture

So, you are saying that the default behaviour is catering to an edge case...

Besides, I can't imagine anyone actually wanting two steps for this process, even if it takes a long time. I also can't imagine a maintainer wanting to leave the site in an inconsistent state for even a second. i.e. in a state where the system knows content access needs to be rebuilt, but has not been rebuilt (ie. a broken state)

I guess my major issue is that the current behaviour makes Drupal look incompetent. There is no indication to the user that the system is trying to do them a favour by not running what it knows needs to be run.

At the very least, it should run immediately for sites with less than a 1000 nodes (or some such threshold) Maybe there should be a setting for the threshold (default to 10,000), so that the handful of maintainers who do need to split the process can choose to do so without making it a pain in the butt for the rest of us. The message displayed to the user should also say WHY access was not rebuilt automatically, so the user with a huge site can choose whether they want that behaviour.

The more I think about it, the more I think node_access_needs_rebuild() should just be removed from Drupal altogether. There are other better options. Run it in batches via cron for example.

bkosborne’s picture

Having it run automatically for < 1000 nodes or so seems logical to me. Looks like node_access_build() has a batch parameter as well, so perhaps that could be used regardless. A new issue should be opened for this since this issue is already closed.