<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Jason Flatt wrote:
<blockquote cite="mid200602221250.25736.drupal@oadae.net" type="cite">
  <pre wrap="">On Wednesday 22 February 2006 12:34 pm, David Grant wrote:
  </pre>
  <blockquote type="cite">
    <pre wrap="">How do I allow other users to edit content others have created?

For example, user1 creates a story. user1 can edit the story. How can I
give user2 rights to edit the story as well? There is a permission for
"edit own content" under stories but there is no "edit all content"
under stories. This seems like a severe limitation to me.

Thanks,
David
    </pre>
  </blockquote>
  <pre wrap=""><!---->
Modify the code for the story.module.

Specifically, edit line number 32, thusly:

  return array('create stories', 'edit own stories');

to something like:

  return array('create stories', 'edit own stories', 'edit any stories');

And add something like the following to the story_access() function:

  if ($op == 'update' || $op == 'delete') {
    if (user_access('edit any stories')) {
      return TRUE;
    }
  }

Disclaimer:  The above is UNTESTED code for the 4.6.5 version!

  </pre>
</blockquote>
Thanks a lot!<br>
<br>
My first question is, if I add a permission like this...what happens
when I upgrade to 4.7 eventually? Any problems there?<br>
<br>
I just checked out the story.module code... and it looks like the
solution might be a bit simpler. Here it is:<br>
<tt>if ($op == 'update' || $op == 'delete') {<br>
&nbsp;&nbsp;&nbsp; if (user_access('edit own stories') &amp;&amp; ($user-&gt;uid ==
$node-&gt;uid)) {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return TRUE;<br>
&nbsp;&nbsp;&nbsp; }<br>
&nbsp; }<br>
</tt><br>
I could just remove the <tt>&amp;&amp; ($user-&gt;uid == $node-&gt;uid)</tt>
which means that "edit own stories" permission now means "edit all
stories" because there is no check whether or not they are the owner,
just that they have the "edit own stories" permission. There are
basically 3 people on the site in a "content creator" role. I want
those people to be able to collaboratively edit content (ie. fix their
typos, change wording, etc...) like on a wiki.<br>
<br>
I could break up the logic...so that the <tt>($user-&gt;uid ==
$node-&gt;uid)</tt> would be required to delete a story but not to edit
it... <br>
<br>
I dunno, I'm a bit of a n00b, does this make some sense? Can anyone
poke any holes into this idea?<br>
<br>
Thanks,<br>
Dave<br>
<br>
</body>
</html>