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.

Comments

porchlight created an issue. See original summary.

porchlight’s picture

Issue summary: View changes
StatusFileSize
new1.86 KB
porchlight’s picture

StatusFileSize
new1.89 KB

More applicable comment in the .module

porchlight’s picture

damienmckenna’s picture

Status: Active » Needs review
damienmckenna’s picture

Going 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?

damienmckenna’s picture

@rvillan created a near identical solution in another issue.

damienmckenna’s picture

StatusFileSize
new3.69 KB
new3.96 KB

Combining 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.

damienmckenna’s picture

Oh, the patch in #9 also allows people who have the 'administer panelizer' permission to access the 'save as default' option.

  • DamienMcKenna committed f65e3c8 on 8.x-3.x
    Issue #2847351 by porchlight, rvillan, DamienMcKenna: Permission to 'Set...
damienmckenna’s picture

Status: Needs review » Fixed

Committed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.