Currently, PanelsStorageInterface::access($id, $op, $account) takes the standard CRUD ops like create, read, write, delete.

We should add a special 'change layout' op that the IPE can use to see if the user has permission to change the layout in the underlying storage.

This is important because traditionally Panelizer has had seperate permissions for manipulating content and changing the layout (presumably to prevent certain users from changing the layout on certain types, only allowing them to change the content).

We'll need to add support for this to page_manager too, as it's the only other user of the PanelsStorage API.

Comments

dsnopek created an issue. See original summary.

dsnopek’s picture

Issue tags: +panelizer
phenaproxima’s picture

Status: Active » Needs review
StatusFileSize
new3.12 KB

First attempt. This adds support for the "change layout" permission to Panels IPE.

Status: Needs review » Needs work

The last submitted patch, 3: 2659546-3.patch, failed testing.

phenaproxima’s picture

Status: Needs work » Needs review
StatusFileSize
new764 bytes

Following discussion with @dsnopek on IRC, we decided to simply change the definition of PanelsStorageInterface::access so that the 'change layout' permission implicitly checks the 'update' permission. There is no implementation of this class in Panels itself, so all the patch needs is a doc comment change.

Status: Needs review » Needs work

The last submitted patch, 5: 2659546-5.patch, failed testing.

phenaproxima’s picture

Status: Needs work » Needs review
StatusFileSize
new3.65 KB
new2.6 KB

Added more access control -- the layout form is no longer accessible without the 'change layout' permission, and the Panels IPE JavaScript will respect that as well and hide the "Change Layout" tab if the user does not have the appropriate access.

Status: Needs review » Needs work

The last submitted patch, 7: 2659546-7.patch, failed testing.

The last submitted patch, 7: 2659546-7.patch, failed testing.

  • japerry committed 9b9a4d4 on 8.x-3.x authored by phenaproxima
    Issue #2659546 by phenaproxima: Add special 'change layout' op to access...

japerry’s picture

Status: Needs work » Fixed

Looks good, merged in.

Status: Fixed » Closed (fixed)

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