5121 Posts in 1527 Topics by 1119 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1992 Views |
-
Hiding page types and pages in site tree

4 September 2009 at 2:51am
If I have a site with various administrators/contributers who all have a different level of access to their part of the site, how can I make sure that in the drop down of 'page types' only certain page types relevant to that administrators section are available to them.
Also in the site tree I want to hide the pages not available to them.
How can I do this?
Regards
-
Re: Hiding page types and pages in site tree

4 September 2009 at 3:36am
Have a look at the canCreate, canEdit, canView, canDelete, canPublish and canAddChildren method of the SiteTree Class (sapphire/core/model/SiteTree.php).
You can override these methods in your Page class to implement the desired access restrictions
-
Re: Hiding page types and pages in site tree

8 September 2009 at 8:45am
That's great, thanks for the advice.
Also though I need to know how to be able to not display pages in the site tree on the left pane that don't apply to a particular user.
So for instance if I'm only permitted to update a news page, all I would like to see is the news page in the site tree, not the contact us and about us pages.
Is that at all possible?
-
Re: Hiding page types and pages in site tree

8 September 2009 at 10:23am
Some things can already be done with the page access-settings. For a solution like yours, you'll probably have to implement some of the methods I mentioned previously.
The pages in the dropdown can be limited, by checking the current user and his access-rights in the "canCreate" method and returning true (can create) or false (cannot create).
I'm not sure if there's an easy method to hide pages from showing up in the site-tree. Maybe you'll have to subclass site tree and implement the desired behavior yourself. I never did this, so I cannot tell you if that would be an easy thing to do. -
Re: Hiding page types and pages in site tree

29 July 2012 at 11:55am
I solved it with adding this to tree.css
ul.tree li .disabled {
display: block;
}each pagetyp get css attr "disabled" which can't "viewed". -> canView function
| 1992 Views | ||
|
Page:
1
|
Go to Top |



