|
Cookbook /
Edit-Restricted ProfileSummary: Authors can only edit their own pages in the Profiles group.
Version: 2007-07-24
Prerequisites:
Status:
Maintainer:
Categories: Administration
DescriptionAuthors can only edit their own pages in the Profiles group if you place the following code in local/Profiles.php
<?php if (!defined('PmWiki')) exit();
## Author's name must match the page name in order to edit.
if ($action == 'edit' && ! CondAuth(@$pagename, 'admin')) {
@include_once($FarmD.'/scripts/author.php');
if ($Author && $Author != @PageVar($pagename, '$Name')) {
$action='login'; }
}
Drawbacks:
A possible improvement would be to replace $action='browse'; }
with redirect($AuthorGroup.'.EditAccessDenied'); }
and create a Profiles.EditAccessDenied page (or a page with a better name) with a message explaining what has happened. NotesThis solution was first posted in PITS:00538 Release NotesCommentsSee AlsoContributors |