Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I'd like to allow users in acertain role view diffs, is this possible without a huge rewrite of the code?
Comment | File | Size | Author |
---|---|---|---|
#7 | diff-880916.patch | 6.43 KB | realityloop |
#4 | diff-880916.patch | 3.53 KB | realityloop |
#2 | per-content-type-revision-inline-diffd6.patch | 1.95 KB | realityloop |
Comments
Comment #1
realityloopOnly for Inline diffs, not the revisions tab.
Comment #2
realityloopPutting this here for reference:
http://drupal.org/node/880940
Comment #3
drupalninja99 CreditAttribution: drupalninja99 commented+1 and we need a permission asap (please) for the 'view changes' field as well, it auto-turns on for every content type and any user has access to the view changes button, we really need a 'view changes' permission attached to that.
Comment #4
realityloop@jaykali could you please test this patch against dev from 2010-Aug-13, it has perm for 'view changes button' as you requested as well.
I've added support here for people that want to use my patch at #2 as well.
I fear that 'view inline diff' perm may be somewhat redundant now that the inline diff uses a block, meaning you can apply role based access to it there.
I'd like expand these perms per content type in line with my patch at #2 if people think it would be useful. I will need to discuss it with other maintainers of Diff as well though.
Comment #5
yhahn CreditAttribution: yhahn commentedSome feedback:
A clearer sense of how the different permissions interact with each other would be good. For example, the new check for inline diffs appears to be this:
Where the
view inline diff
perm becomes mostly a negative check - e.g. you must have it in addition to theview revisions
permission. I think this makes sense but I wonder if there are use cases where site builders might want the opposite - e.g. users who can view diffs inline without being pestered by the revisions tab.The next action here is to spell out explicitly (perhaps in the comment block above
hook_perm()
) what each permission does and how it relates to permissions not provided by diff (ie.view revisions
).More consistent permission naming. I've never been a fan of the phrase
view inline diff
and now that we are adding additional perms for other aspects of diff I wonder if a good set might be:view diff
Allows users to see side-by-side diffs for revisions.
view diff inline
Allows users to see inline diffs.
view diff preview
Allows users to see diff preview when editing nodes.
Comment #6
realityloopYhahn, good points.
My aim was to create a way to enable inline diff without the revisions tab eventually, I just wasn't sure how, but you've given me something to try.
I'll do some work and reroll a patch early next week.
Comment #7
realityloopyhahn: I've done some further work on this, unfortunately I'm stuck on how to remove the requirement for 'view revisions'.
line 112 of diff.module calls:
_node_revision_access() requires the users to have at least 'view revisions' perm, any ideas?
Once I can figure this out I'll do clean up and submit a final patch.
Comment #8
Taxoman CreditAttribution: Taxoman commentedIs this development currently done on 6.x or 7.x?
Comment #9
Alan D. CreditAttribution: Alan D. commentedAnd is this still relevant as per the comment in #1013146: Need More Granular Permissions?
Comment #10
mitchell CreditAttribution: mitchell commentedBumping to 7.x-3.x.