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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong link without edit premissions #89

Closed
AljosaB opened this issue Mar 18, 2019 · 5 comments
Closed

Wrong link without edit premissions #89

AljosaB opened this issue Mar 18, 2019 · 5 comments

Comments

@AljosaB
Copy link

AljosaB commented Mar 18, 2019

There is GridFieldSiteTreeEditButton that fixes edit link, but if current user doesn't have edit permissions the link is broken because the component is replaced with GridFieldViewButton during performReadonlyTransformation. There sould also be an extended GridFieldViewButton (GridFieldSiteTreeViewButton) that would fix the link.

Note that the permissions here are for the parent record. i.e. you can't edit the parent record, so the gridfield of the children is make readonly.

PRs

@NightJar
Copy link

Thanks for taking the time to report this issue @AljosaB - could you please also tell us when version of SilverStripe and version of Lumberjack you're using?

@AljosaB
Copy link
Author

AljosaB commented Mar 19, 2019

SS 4.3.2 and latest Lumberjack. I created a pull request #90

@robbieaverill
Copy link

Are you able to provide some steps to reproduce? When I set SiteTree::canEdit() to false I still get the GridFieldSiteTreeEditButton, which matches its docblocks:

 * Swaps the GridField Link out for the SiteTree edit link using {@link SiteTree::CMSEditLink()}.
...
        // No permission checks - handled through GridFieldDetailForm
        // which can make the form readonly if no edit permissions are available.

@AljosaB
Copy link
Author

AljosaB commented Mar 22, 2019

Just set some permissions on holder/listing page (the one with Lumberjack extension applied). For example define "who can edit this page" to administrators group. Then open the page with a user in content editors group and you'll get view buttons in lumberjack gridfield.

SS: 4.3.2
Lumberjack: master (latest)

image

@emteknetnz
Copy link
Member

Linked PRs have been merged, then will be released in CMS 5.3

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

No branches or pull requests

4 participants