Active
Project:
View Unpublished
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
24 Jun 2009 at 02:42 UTC
Updated:
1 Nov 2014 at 04:48 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
entendu commentedRevisions would be a little more complicated -- I'm kind of ambivalent on its usefulness vs. amount of effort. If some more people roll in and say they want it too, maybe a different story... anyone?
Comment #2
agileware commentedThis would be a great feature if it is possible.
Is there a chance this functionality might make it in?
Comment #3
agileware commentedHere is a patch for views_unpublished with revision support.
I ran into problems while using this with the diff module and the revision moderation module so this patch also includes code to allow these modules to work together.
It could be done without the code relating to those modules but seeing as those modules have high usage it is probably best to keep it in.
It gives two new permissions for view unpublished revisions and revert unpublished revisions.
Instructions are included in the readme in case they're needed.
This patch also includes a few coding standards fixes.
The patch will apply to 5.x-1.x-dev and 5.x-1.0
Comment #4
agileware commentedI haven't looked into the d6 version but I'm sure this could be ported with out too much hassle if people want it.
Comment #5
rooby commentedHere is a new version of the patch in #3 that dynamically assigns the modules weight on install.
Comment #6
jbomb commentedBumping to 6.x branch as this is not yet supported.
This patch checks user permissions for node revisions, if a user has access to view, revert or delete revisions the access callback is altered to check if the user has access to view the node in an 'unpublished' state. No alterations are made to node revision access for users that do not have at least 'view revisions'.
[edit] : this patch will also allow users with 'view revisions' permission to view revision diffs, provideded by the diff module.
Comment #7
rickvug commentedThe patch in #6 does not respect a user's permission. I believe that what is happening is that the menu alter results are cached. Since admin is likely the last one to have caused a menu rebuild the access rules for admin are applied. Perhaps what should happen here is that hook_menu_alter changes the access callback to one of our own making.
Comment #8
rickvug commentedAttached is a new patch that takes the approach of view_unpublished supplying its own access callback for node revisions. It only applies to viewing revisions at the moment. It certainly needs work and review, especially when it comes to also working with revert and delete permissions. There is also the issue of providing the revision information fieldset to users who do not have access to the "administer nodes" permission.
Comment #9
technikh commentedinterested.
subscribing..
Comment #10
goldTesting patch in #8 now. Got one hunk fail in the hook_menu(). Easily patched by hand. Looking at the patch though it should be easy enough to build this in as a separate module if it's not accepted into this one.
Anyway... on with testing.
Comment #11
goldThis appears to work as advertised. The attached patch is made against the 6.x-1.x branch from git so should patch without the failed hunk.
Comment #12
hanoiiClean up the patch a little bit and added support for diff module. I guessed that as this module modifies the core node access menu, it should modify other modules as well.
This should sort out #670852: Access Denied when viewing revisions for an unowned, unpublished node which is on the diff issue queue.
Comment #13
hanoiiJust noting this is, for now, only to view revisions, not revert or delete as those needs further thinking as stated in 8.
Comment #14
yesct commentedthis might be what I need.
Comment #15
entendu commentedIs this RTBC?
Comment #16
hanoiiI appeared to be the only tester, but maybe you can review/test yourself?
Comment #17
hanoiiattached is a new patch with an improved version, followed new commits done on #1180572: Access Denied due to incorrect menu "access callback"
Comment #18
entendu commentedThere's an incomplete comment here, could you take a look?
Also, is there any reason to save the old access_arguments?
I realize
_view_unpublished_node_revision_access()is going to need an array, but the format is non-obvious because= $items[$menu]['access callback']is actually creating an empty element, rather than assigning a value like it does higher up in the function.Comment #19
hanoiiWhy an empty element? And if it is an empty element, then it will be passed as empty all over the code, so no harm in that I think, but not sure I understood you correctly.
I am trying to follow the same approach of with the node/%node/view , what is it that you see different?
I already fixed the comment.
Comment #20
nwom commentedAny update on this?
Would love to see a d7 version of this patch. Sadly I need to look for another solution in the meantime.
Thanks for all the work done so far.
Comment #21
entendu commentedDeprecating 6.x.
Comment #22
rooby commentedIn that case, can someone confirm whether or not this is something that is still missing from the Drupal 7 version?