Even with panalizer default permissions disabled for a user, they can still revert a panelized page to the default (wiping out all panalizer revisions) and then override the default panel with the buttons in IPE. I reused the core "Delete content revisions" and the ""administer panelizer @entity @bundle defaults" permissions to remove the buttons for users who do not have those permissions.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

frankcarey’s picture

FileSize
2.67 KB
DamienMcKenna’s picture

Status: Needs review » Needs work

Using t() to insert values into a permission string is the incorrect approach to take, just insert the variables like so: "administer panelizer $entity $bundle defaults"

Also, It's more correct to create the form element and set the '#access' attribute to the user_access() statement.

DamienMcKenna’s picture

Also, check how the revert option works now that #2218275: 'Reset' should not delete all {panelizer_entity} records for the entity has ben committed - it should no longer just delete all displays for all revisions.

DamienMcKenna’s picture

Version: 7.x-3.1 » 7.x-3.x-dev
guillaumev’s picture

Status: Needs work » Needs review
FileSize
650 bytes

Agreed with all of the above, and here is a new patch taking the comments into account.

guillaumev’s picture

FileSize
621 bytes

Actually there was an issue with this patch. Here is the new one, which should work properly.

DamienMcKenna’s picture

FileSize
1.2 KB

Update to use $handler->panelizer_access() instead of user_access().

DamienMcKenna’s picture

Status: Needs review » Fixed

Committed.

FYI I'm adding a changenotice for this.

Status: Fixed » Closed (fixed)

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