How to make Articles Editable “Only by Author”?
I wanted to have articles edited only by the ones who create them (Author) and provide the Author a way to manually allow additional authors to edit the article.
As the goal of this article is to limit control over the News articles, it seems logical to create a group of editors that don’t have permission to remove articles, not? To achieve this, just make sure the article editors don’t have the “Delete News Articles” permission…
- 1. Create a new folder: /module_custom/News/templates
- 2. Copy the file “editarticle.tpl” from the /modules/News/templates folder in to the folder you just created
Change the top of the /module_custom/News/templates/editarticle.tpl file like this:
{capture assign=’adminname’}{$smarty.session.cms_admin_username}{/capture}
{if substr_count($extravalue, $adminname)}{assign var=’editor’ value=’1′}{/if}
{if $adminname == “$inputauthor” || $adminname == ‘##REPLACE_WITH_YOUR_OWN##’ || $inputauthor == ” || $editor == ‘1’}
{if $inputauthor}
This will allow the following scenarios where the article content can be edited:
- – The logged in user is the author
- The logged in user is the admin (probably you
- – No author has been set (allows creation of new articles)
-
- – ps: As a consequence, if you remove a user login from the CMSMS installation, his or her articles become editable by everyone else…
- – The logged in user is an “additional editor” (entered manually by the original Author)
Change the bottom of the file like this:
When editing or creating an article, the Author may enter user names of the “additional editors” in the Extra field separated by comma’s (or not
To avoid users (easily) publishing and unpublishing each others articles, you can remove these buttons from the article list view.
Authors and “additional authors” will still have the possibility to publish/unpublish while editing the articles.
- 1. Copy the file “articlelist.tpl” from the /modules/News/templates folder in to the /module_custom/News/templates folder
- 2. Comment out (or remove) the following lines:
- 1. <th>{$statustext}</th>
- 2. <td>{if isset($entry->approve_link)}{$entry->approve_link}{/if}</td>
ps: if someone happens to know how to easily change the Author of an article, please let me know!
ps2: I’ve also posted this article on the i-do-this blog.
ps3: A shout if you like what you see is appreciated