On Wed, Sep 1, 2010 at 4:53 PM, Ken Newquist <span dir="ltr"><<a href="mailto:newquisk@lafayette.edu">newquisk@lafayette.edu</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">The only specific role tweak that's one our wish list is to allow Authors to create drafts of pages (which could then be published by Editors). Right now only Editors can draft and publish pages (which isn't in keeping with the Contributor -> Author progression, where contributors can create drafts of posts, but Authors can publish them; I'd love to see that progression replicated with Author -> Editor for pages).</div>
</blockquote><div><br></div><div>Changing the functionality of a core role is not something we can really do, even if that makes sense, for compatibility reasons.</div><div><br></div><div>It's actually a really simple plugin. All you need to do is give Author the edit_pages capability. Two ways to do it -- alter the role in the database, or do a filter at runtime. No need to worry about plugin upgrades in that case, or compatibility with changes to core.</div>
<div><br></div><div>This untested example modifies the roles definition in the DB:</div><div><br></div><div>class Nacin_Authors_Draft_Pages {</div><div> function Nacin_Authors_Draft_Pages() {</div><div> register_activation_hook( __FILE__, array( &$this, 'activate' ) );</div>
<div> register_deactivation_hook( __FILE__, array( &$this, 'deactivate' ) );</div><div> }</div><div> function activate() {</div><div> $role = &get_role( 'author' );</div><div> $role->add_cap( 'edit_pages' );</div>
<div> }</div><div> function deactivate() {</div><div> $role = &get_role( 'author' );</div><div> $role->remove_cap( 'edit_pages' );</div><div> }</div><div>}</div><div>new Nacin_Authors_Draft_Pages;</div>
</div>