Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
BUGFIX: Content authors with SiteTree#canView() but not SiteTree#canE…
…dit() were unable to click on SiteTree items in the CMS. - The 'disabled' attribute in <li> will now only render if the author _really_ can't do _anything_
- Loading branch information
9281ebc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I disagree with this commit, in really big SiteTree it's useful to have access just to the area where the user can edit/add children.
If a user would like to see the content of a page where he has not access he can pass through the frontend.
9281ebc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@g4b0 If you want to trim down large trees for some of your users (" just to the area where the user can edit/add children"), then I would suggest you return canView=FALSE for these users. I don't really see the problem here, other than you having to update your
canEdit()
logic to (partially) move tocanView()
?9281ebc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
9281ebc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had some testing on this argument, and I still think that this commit is not correct. If I remove the "canView" permission to some user he can't view the page also in the frontend.
In particular I can't find a way to disable the access at the SiteTree to anyone in the CMS except for their little working area, letting everybody (in particular not logged users) still view the content in the frontend.
Here you are how is working my SS 3.1-beta3:
The logged user can just edit small area, and it's clear for him which pages he can edit. In the other side the logged user still can view the entire site.
9281ebc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@GB40 Can you describe, step-by-step your use-case?
From what I can tell from your description, this change won't affect anything in the front-end. It's used to decide whether or not to add a "disabled" CSS class to items in the CMS SiteTree. If a CMS author has canView() permissions on a page, but she cannot physically select the SiteTree item to view it because it is disabled, then this patch fixes this.
9281ebc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like that a user that can access only certain pages in edit mode views the other pages in SiteTree listed in grey color, like in the image above.
Maybe I fixed it with #759 and silverstripe/silverstripe-framework#2039, I'm just waiting for merge.