I created a default Panels layout for multiple users who each have their own "homepage". I want them to be able to move content around and save their own content layout, but I don't want them to have permission to "Set as Default" and ruin the default layout I've set up initially. So I added a permission, and I hide the "Set as Default" button based on that. Probably a better way to do it, but it works for me.
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | panelizer-n2847351-9.interdiff.txt | 3.96 KB | damienmckenna |
| #9 | panelizer-n2847351-9.patch | 3.69 KB | damienmckenna |
Comments
Comment #2
porchlight commentedComment #3
porchlight commentedMore applicable comment in the .module
Comment #4
porchlight commentedComment #5
damienmckennaComment #6
damienmckennaGoing to add this to beta1 as I need it for a project.
I wonder is there a better way of doing this that will block the AJAX callback itself, to prevent someone from hacking the JS in order to save it?
Comment #8
damienmckenna@rvillan created a near identical solution in another issue.
Comment #9
damienmckennaCombining the change from #2849264: Restrict access to the "Save as default" option in the panels in-place editor tray so that the "save as default" button doesn't show up if the user does not have access to see it. I also changed the label of the 'save as custom' link to just "Save" if there's only one button.
Comment #10
damienmckennaOh, the patch in #9 also allows people who have the 'administer panelizer' permission to access the 'save as default' option.
Comment #12
damienmckennaCommitted.