Closed (fixed)
Project:
Diff
Version:
7.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
22 Nov 2016 at 18:57 UTC
Updated:
14 Jun 2018 at 14:41 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
joelpittetI'm using the menu callback to aid in calling both the node type check and revision check.
Comment #3
joelpittetWhoops, not instant RTBC:P
Comment #5
joelpittetTesting suite is on but there are no tests in this module. Setting back to needs review.
Comment #7
alan d. commentedThanks. Too funny, only 5 years for someone to pick that up :)
Slightly lazy cp n paste, no other changes:
...(.., $op = 'view')Potential risk of a PHP notice if there is code that depends on this old invalid logic, I nearly used an #access flag instead. i.e.
Comment #8
joelpittetlol, yeah whoops that was lazy, but at least you know both it's value and it's param name:) named
paramsargs for the win:DThanks for committing that!
Comment #9
alan d. commentedMmm. Sorry, I was blindly rolling out patches...
Does this make sense? View changes on the node form compares the existing page and what they are about to save. So this has nothing to do with revision access so to speak.
Or am I missing something here?
Without adding more complexity, maybe a hook_permission() with a 'diff view current changes' and using this as a check.
So existing commit with new hook and slight mod.
Thoughts?
Comment #10
joelpittetAh sorry, I was confusing things, I thought it was for the page. It totally needs a new permission, 'diff view changes' maybe to be sussinct?
Comment #11
alan d. commentedThoughts?
Comment #13
joelpittetThanks that looks more straight forward.
You could use the placeholder for the button title in the description too for consistency, leave that to your discretion.
Comment #15
alan d. commentedI skipped without trying as I thought it would be a bit messy, but it wasn't too bad in hindsight ;)
Thanks!
Comment #18
shenzhuxi commentedHello...I know this issue has been closed for years. But I still believe user_access('diff view changes') should not only control the display of one button but also the access to node/%node/revisions/%/%. There should be a role-based switch for the whole diff/compare function.