[support] How-to allow other users to edit content created by
others
David Grant
david.grant at telus.net
Thu Feb 23 19:56:04 UTC 2006
Jason Flatt wrote:
> To break out edit and delete, you would want something like this (in place of
> what is there):
>
> if ($op == 'update') {
> if (user_access('edit all stories')) {
> return TRUE;
> }
> }
>
> if ($op == 'delete') {
> if (user_access('delete own stories') && ($user->uid == $node->uid)) {
> return TRUE;
> }
> }
>
> With the relevant changes in the store_perm () function, and again, this is
> untested.
>
> You could go all out and have all, nothing and any little piece in between,
> i.e.: create, edit or delete; none, yours or any.
>
>
Thanks a lot again for your help.
When I did a quick test yesterday, I just got rid of && ($user->uid ==
$node->uid) and what happened was the people that weren't the author
couldn't delete even though is was under the if 'delete' || 'update'.
Not sure why, but that was the behaviour. I found it interesting as
well, that the author immediately changed to the new editor, which was a
little unwanted/unexpected. I guess there is a hook somewhere to allow
users with the 'edit all stories' permission to edit the author
information as well... currently I think only user 0 can do that.
Dave
More information about the support
mailing list