Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix stack access with advanced permissions - Take 2 #7061

Merged
merged 6 commits into from
Sep 28, 2018

Conversation

mlocati
Copy link
Contributor

@mlocati mlocati commented Sep 19, 2018

This pool 馃槈 request is an alternative to #7029.
Here I'm trying to implement what @aembler suggested.

WARNING it's not yet done, I'm currently facing a big issue, as described below.

Let's assume that we configure the stack with the following page permissions:

immagine

  • if we don't specify these lines, the resulting area permissions are the following ones (the user can't add blocks to the stack):

    immagine

  • if we specify these lines, the resulting area permissions are the following ones (the user can add blocks to the stack):

    immagine

    BUT, since the permission "can add block to page" is not implemented, we have this error here:

    Call to undefined method
    Concrete\Core\Permission\Access\ListItem\PageListItem::getBlockTypesAllowedPermission()
    

    ...which I really don't know how to solve 馃槩

@mlocati
Copy link
Contributor Author

mlocati commented Sep 21, 2018

This PR should be ready to be reviewed/merged: the main issue is #7086

@mlocati
Copy link
Contributor Author

mlocati commented Sep 24, 2018

I can confirm that everithing works.

This pull request is still needed because with it:

  • we consistently check the permissions when handling stacks
  • we check if a user can add a localized version of a stack
  • we show only the allowed operations in the /dashboard/blocks/stacks dashboard page
  • we enable the editing UI for stacks even when users have access only to a stack

Bonus tracks:

  • use STACKS_LISTING_PAGE_PATH instead of '/dashboard/blocks/stacks'
  • minor code cleanups
  • show the correct name of the object type when displaying permissions inheritance ("This page inherits its permissions from" vs "This stack inherits its permissions from" vs "This global area inherits its permissions from")

I can of course close this PR and open different PRs...

@mlocati
Copy link
Contributor Author

mlocati commented Sep 24, 2018

PS: I applied this PR to one of our production sites and everything seems to work fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants