<?xml version="1.0"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Forum posts to 'Archive'</title>
		<link>http://www.silverstripe.org/archive/rss</link>
		<atom:link href="http://www.silverstripe.org/archive/rss" rel="self" type="application/rss+xml" />
		<description></description>

		
		<item>
			<title>Re: Disabling Publish Button</title>
			<link>http://www.silverstripe.org/archive/show/122579?start=0#post161524</link>
			<description>&lt;p&gt;I get an error when i try to do this:&lt;/p&gt;&lt;p&gt;Parse error: syntax error, unexpected T_PROTECTED in /home/admin/domains/silverstripe.ilink2.nl/public_html/mysite/code/Page.php on line 21&lt;/p&gt;&lt;p&gt;This is my PHP code:&lt;/p&gt;&lt;p&gt;&amp;lt;?php&lt;/p&gt;&lt;p&gt;class Page extends SiteTree {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;static $db = array(&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;static $has_one = array(&lt;br /&gt;   );&lt;br /&gt;}&lt;/p&gt;&lt;p&gt;class Page_Controller extends ContentController {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;function init() {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;parent::init();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Requirements::themedCSS(&quot;layout&quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Requirements::themedCSS(&quot;typography&quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Requirements::themedCSS(&quot;form&quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;}&lt;/p&gt;&lt;p&gt;// Group names that have publishing permissions (only groups listed here can publish/unpublish)&lt;br /&gt;protected $publisherGroups = array(&lt;br /&gt;   &quot;Administrators&quot;&lt;br /&gt;);&lt;/p&gt;&lt;p&gt;function canPublish() {&lt;br /&gt;   $member = Member::currentUser();&lt;br /&gt;   return $member-&amp;gt;inGroups($this-&amp;gt;publisherGroups);&lt;br /&gt;} &lt;/p&gt;&lt;p&gt;?&amp;gt;&lt;/p&gt;&lt;br&gt;&lt;br&gt;Posted to: Disabling Publish Button &lt;a href=&quot;http://www.silverstripe.org/archive/show/122579?start=0#post161524&quot;&gt;Show Thread&lt;/a&gt; | &lt;a href=&quot;http://www.silverstripe.org/archive/reply/122579?start=0#post161524&quot;&gt;Post Reply&lt;/a&gt;</description>
			<pubDate>Sat, 06 Sep 2008 00:21:42 +1200</pubDate>
			<dc:creator>olafmol</dc:creator>
			<guid>http://www.silverstripe.org/archive/show/122579?start=0#post161524</guid>
		</item>
		
		<item>
			<title>Re: Disabling Publish Button</title>
			<link>http://www.silverstripe.org/archive/show/122579?start=0#post155740</link>
			<description>&lt;p&gt;Hi,&lt;/p&gt;&lt;p&gt;I am not sure if that is what you mean: If you add this method to your Page class in &lt;span style=&quot;color:blue&quot;&gt;/mysite/code/Page.php&lt;/span&gt; ...&lt;/p&gt;&lt;p&gt;&lt;div class=&quot;codesnippet&quot;&gt;&lt;p&gt;// Group names that have publishing permissions (only groups listed here can publish/unpublish)&lt;br /&gt;protected $publisherGroups = array(&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&quot;Administrators&quot;,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&quot;Editors&quot;&lt;br /&gt;);&lt;/p&gt;&lt;p&gt;function canPublish() {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;$member = Member::currentUser();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;return $member-&amp;gt;inGroups($this-&amp;gt;publisherGroups);&lt;br /&gt;}&lt;/p&gt;&lt;/div&gt;&lt;/p&gt;&lt;p&gt;... then only members of the groups in the $publisherGroups array can publish/unpublish. If you have another group e.g. &quot;Non-publishing Editors&quot; members of this group could only save, but not publish.&lt;/p&gt;&lt;p&gt;I wanted to add an additional permission code to the CMS Security section, but I could not figure out how. It would be nice to have an option like &quot;has publishing rights&quot; to choose from the permissions dropdown.&lt;/p&gt;&lt;p&gt;For me the solution above is good enough for now, but there was some &lt;a href=&quot;http://www.silverstripe.com/extending-hacking-silverstripe-forum/flat/3679#post4051&quot;&gt;rumour about a permission matrix&lt;/a&gt; about a year ago. Was there any further development?&lt;/p&gt;&lt;p&gt;Cheers!&lt;br /&gt;Anatol&lt;/p&gt;&lt;br&gt;&lt;br&gt;Posted to: Disabling Publish Button &lt;a href=&quot;http://www.silverstripe.org/archive/show/122579?start=0#post155740&quot;&gt;Show Thread&lt;/a&gt; | &lt;a href=&quot;http://www.silverstripe.org/archive/reply/122579?start=0#post155740&quot;&gt;Post Reply&lt;/a&gt;</description>
			<pubDate>Thu, 28 Aug 2008 15:24:06 +1200</pubDate>
			<dc:creator>Anatol</dc:creator>
			<guid>http://www.silverstripe.org/archive/show/122579?start=0#post155740</guid>
		</item>
		
		<item>
			<title>Re: Disabling Publish Button</title>
			<link>http://www.silverstripe.org/archive/show/122579?start=0#post123487</link>
			<description>&lt;p&gt;simon_w I've used the code you provided but an user with access to the CMSMain and LeftAndMain (without admin permissions) is able to add new content and also to publish it.&lt;/p&gt;&lt;p&gt;I don't know if I've done anything wrong, but I think I don't.&lt;/p&gt;&lt;p&gt;EDIT: I've finally got this to work.&lt;/p&gt;&lt;p&gt;I have a question. What is the functionallity of the &quot;return parent::canPublish();&quot;? It wasn't working and I removed this line and it only showed the &quot;Save&quot; as expected.&lt;/p&gt;&lt;p&gt;&lt;div class=&quot;codesnippet&quot;&gt;&lt;p&gt;function canPublish() { &lt;br /&gt;      if(Permission::check('ADMIN')) { &lt;br /&gt;         return true; &lt;br /&gt;  //    } else { &lt;br /&gt;         //return parent::canPublish(); &lt;br /&gt;   //   } &lt;br /&gt;   }&lt;/p&gt;&lt;/div&gt;&lt;/p&gt;&lt;p&gt;EDIT (2): Is it possible to do the same thing based on groups (a group can only add new content and only one can publish)?&lt;br /&gt;Is it really hard to achieve that?&lt;/p&gt;&lt;br&gt;&lt;br&gt;Posted to: Disabling Publish Button &lt;a href=&quot;http://www.silverstripe.org/archive/show/122579?start=0#post123487&quot;&gt;Show Thread&lt;/a&gt; | &lt;a href=&quot;http://www.silverstripe.org/archive/reply/122579?start=0#post123487&quot;&gt;Post Reply&lt;/a&gt;</description>
			<pubDate>Thu, 17 Jul 2008 22:13:01 +1200</pubDate>
			<dc:creator>cerelac</dc:creator>
			<guid>http://www.silverstripe.org/archive/show/122579?start=0#post123487</guid>
		</item>
		
		<item>
			<title>Re: Disabling Publish Button</title>
			<link>http://www.silverstripe.org/archive/show/122579?start=0#post123439</link>
			<description>&lt;p&gt;I may try that sometime. However the security and reports tab on my site do not work at the moment. I get:&lt;/p&gt;&lt;p&gt;Fatal error: Access to undeclared static property: ViewableData::$db in /var/www/vhosts/mags4dorset.co.uk/httpdocs/sapphire/core/Object.php(324) : eval()'d code on line 1&lt;/p&gt;&lt;p&gt;Which I think I can remember reading that is a bug in php 5.1.2 and need to upgrade to 5.2.x&lt;/p&gt;&lt;br&gt;&lt;br&gt;Posted to: Disabling Publish Button &lt;a href=&quot;http://www.silverstripe.org/archive/show/122579?start=0#post123439&quot;&gt;Show Thread&lt;/a&gt; | &lt;a href=&quot;http://www.silverstripe.org/archive/reply/122579?start=0#post123439&quot;&gt;Post Reply&lt;/a&gt;</description>
			<pubDate>Thu, 17 Jul 2008 20:55:11 +1200</pubDate>
			<dc:creator>Pixel</dc:creator>
			<guid>http://www.silverstripe.org/archive/show/122579?start=0#post123439</guid>
		</item>
		
		<item>
			<title>Re: Disabling Publish Button</title>
			<link>http://www.silverstripe.org/archive/show/122579?start=0#post123421</link>
			<description>&lt;p&gt;This can be done easily. Assuming only someone with ADMIN rights can publish, in your Page class add:&lt;br /&gt;&lt;div class=&quot;codesnippet&quot;&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;function canPublish() {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(Permission::check('ADMIN')) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return true;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;} else {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return parent::canPublish();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/p&gt;&lt;/div&gt;&lt;/p&gt;&lt;p&gt;Though having a certain group that is allowed to publish is a bit harder.&lt;/p&gt;&lt;br&gt;&lt;br&gt;Posted to: Disabling Publish Button &lt;a href=&quot;http://www.silverstripe.org/archive/show/122579?start=0#post123421&quot;&gt;Show Thread&lt;/a&gt; | &lt;a href=&quot;http://www.silverstripe.org/archive/reply/122579?start=0#post123421&quot;&gt;Post Reply&lt;/a&gt;</description>
			<pubDate>Thu, 17 Jul 2008 20:43:08 +1200</pubDate>
			<dc:creator>simon_w</dc:creator>
			<guid>http://www.silverstripe.org/archive/show/122579?start=0#post123421</guid>
		</item>
		
		<item>
			<title>Re: Disabling Publish Button</title>
			<link>http://www.silverstripe.org/archive/show/122579?start=0#post123404</link>
			<description>&lt;p&gt;That sounds like a feature that could come in handy. I have almost finished a website for a local community magazine publisher (Will showcase it soonish, just need to set up Paypal and let them add some content) where they post news stories, jobs, editorial articles etc and that would be useful for the Editor to confirm what their staff write.&lt;/p&gt;&lt;br&gt;&lt;br&gt;Posted to: Disabling Publish Button &lt;a href=&quot;http://www.silverstripe.org/archive/show/122579?start=0#post123404&quot;&gt;Show Thread&lt;/a&gt; | &lt;a href=&quot;http://www.silverstripe.org/archive/reply/122579?start=0#post123404&quot;&gt;Post Reply&lt;/a&gt;</description>
			<pubDate>Thu, 17 Jul 2008 20:28:03 +1200</pubDate>
			<dc:creator>Pixel</dc:creator>
			<guid>http://www.silverstripe.org/archive/show/122579?start=0#post123404</guid>
		</item>
		
		<item>
			<title>Disabling Publish Button</title>
			<link>http://www.silverstripe.org/archive/show/122579#post122579</link>
			<description>&lt;p&gt;Hi everyone.&lt;/p&gt;&lt;p&gt;Is there anyway to add a permission that would allow the users to save new content in the CMS without having the permission to publish the content added?&lt;/p&gt;&lt;p&gt;My idea was to let people add new content, but it would only be published by another user with permission to publish.&lt;/p&gt;&lt;p&gt;Thank you.&lt;/p&gt;&lt;br&gt;&lt;br&gt;Posted to: Disabling Publish Button &lt;a href=&quot;http://www.silverstripe.org/archive/show/122579#post122579&quot;&gt;Show Thread&lt;/a&gt; | &lt;a href=&quot;http://www.silverstripe.org/archive/show/122579#post122579&quot;&gt;Post Reply&lt;/a&gt;</description>
			<pubDate>Thu, 17 Jul 2008 02:19:37 +1200</pubDate>
			<dc:creator>cerelac</dc:creator>
			<guid>http://www.silverstripe.org/archive/show/122579#post122579</guid>
		</item>
		

	</channel>
</rss>