<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
  <title>aC forum: User unable to delete uploaded files</title>
  <link>http://www.activecollab.com/forums/topic/1679/</link>
  <description>Recent posts on topic: User unable to delete uploaded files</description>
  <dc:language>en-us</dc:language>
  <pubDate>Thu, 04 Dec 2008 04:51:49 UTC</pubDate>
  
  <item>
    <link>http://www.activecollab.com/forums/post/7995/#post7995</link>
    <guid>http://www.activecollab.com/forums/post/7995/#post7995</guid>
    <title>Post #8 by ianpiper</title>
    <dc:creator>ianpiper</dc:creator>
    <description><![CDATA[<p>That makes good sense. I will update the class file.<br />
<br />
Thanks,<br />
<br />
<br />
Ian.<br />
--</p>]]></description>
    <pubDate>Tue, 19 Jun 2007 13:15:19 UTC</pubDate>
  </item>
  <item>
    <link>http://www.activecollab.com/forums/post/7968/#post7968</link>
    <guid>http://www.activecollab.com/forums/post/7968/#post7968</guid>
    <title>Post #7 by Ilija Studen</title>
    <dc:creator>Ilija Studen</dc:creator>
    <description><![CDATA[<p>No. It means that if user is NOT project user he will not have delete permissions.<br />
<br />
If you change final return false; to return true; any user that is member of that project will be able to delete files. That is too lax IMO. Change the function to something like this:<br />
<br />
<pre name="code" class="html">/**
* Check if specific user can delete this comment
*
* @access public
* @param User $user
* @return boolean
*/
function canDelete(User $user) {
  if(!$user-&gt;isProjectUser($this-&gt;getProject())) {
    return false;
  } // if
  if($user-&gt;isAdministrator()) {
    return true;
  } // if
  if($this-&gt;getCreatedById() == $user-&gt;getId()) {
    return true;
  }
  return false;
} // canDelete</pre><br />
<br />
This way person who uploaded the file will be able to delete is as well.</p>]]></description>
    <pubDate>Sat, 16 Jun 2007 09:33:22 UTC</pubDate>
  </item>
  <item>
    <link>http://www.activecollab.com/forums/post/7967/#post7967</link>
    <guid>http://www.activecollab.com/forums/post/7967/#post7967</guid>
    <title>Post #6 by ianpiper</title>
    <dc:creator>ianpiper</dc:creator>
    <description><![CDATA[<p>Excellent, thanks. If I read this code correctly then any project user (isProjectUser is true) would be able to delete files - does that override any permissions that I explicitly set in the permissions window for a user?<br />
<br />
(I am assuming that I need just to change the final &quot;return false&quot; in the function to &quot;return true&quot;)<br />
<br />
<br />
Ian.<br />
--<br />
</p>]]></description>
    <pubDate>Sat, 16 Jun 2007 09:23:26 UTC</pubDate>
  </item>
  <item>
    <link>http://www.activecollab.com/forums/post/7966/#post7966</link>
    <guid>http://www.activecollab.com/forums/post/7966/#post7966</guid>
    <title>Post #5 by Ilija Studen</title>
    <dc:creator>Ilija Studen</dc:creator>
    <description><![CDATA[<p>No, it is related with the file (docblock is not correct, most probably I just copied permissions methods from comment class and altered them without changing documentation messages).</p>]]></description>
    <pubDate>Sat, 16 Jun 2007 07:33:31 UTC</pubDate>
  </item>
  <item>
    <link>http://www.activecollab.com/forums/post/7965/#post7965</link>
    <guid>http://www.activecollab.com/forums/post/7965/#post7965</guid>
    <title>Post #4 by ianpiper</title>
    <dc:creator>ianpiper</dc:creator>
    <description><![CDATA[<p>I just looked at the code. From the comment above the code it seems to be refering to comments rather than files. <br />
<br />
    /**<br />
    * Check if specific user can delete this comment<br />
    *<br />
    * @access public<br />
    * @param User $user<br />
    * @return boolean<br />
    */<br />
    function canDelete(User $user) {<br />
      if(!$user-&gt;isProjectUser($this-&gt;getProject())) {<br />
        return false;<br />
      } // if<br />
      if($user-&gt;isAdministrator()) {<br />
        return true;<br />
      } // if<br />
      return false;<br />
    } // canDelete<br />
<br />
<br />
Am I looking in the right place?<br />
<br />
<br />
Ian.<br />
--</p>]]></description>
    <pubDate>Fri, 15 Jun 2007 22:47:40 UTC</pubDate>
  </item>
  <item>
    <link>http://www.activecollab.com/forums/post/7964/#post7964</link>
    <guid>http://www.activecollab.com/forums/post/7964/#post7964</guid>
    <title>Post #3 by ianpiper</title>
    <dc:creator>ianpiper</dc:creator>
    <description><![CDATA[<p>Thanks, that answers my question. I will take a look at the code and see whether hacking it is something I can cope with :-)<br />
<br />
<br />
Ian.<br />
--</p>]]></description>
    <pubDate>Fri, 15 Jun 2007 22:40:47 UTC</pubDate>
  </item>
  <item>
    <link>http://www.activecollab.com/forums/post/7960/#post7960</link>
    <guid>http://www.activecollab.com/forums/post/7960/#post7960</guid>
    <title>Post #2 by Ilija Studen</title>
    <dc:creator>Ilija Studen</dc:creator>
    <description><![CDATA[<p>Only administrators can delete files (don't ask me why, from some reason it seamed like a good idea back than :) ).<br />
<br />
To change that behavior you'll need to hack ProjectFile class and alter canDelete() function (somewhere around line 488). ProjectFile class is defined in:<br />
<br />
/application/models/project_files/ProjectFile.class.php</p>]]></description>
    <pubDate>Fri, 15 Jun 2007 18:01:09 UTC</pubDate>
  </item>
  <item>
    <link>http://www.activecollab.com/forums/post/7959/#post7959</link>
    <guid>http://www.activecollab.com/forums/post/7959/#post7959</guid>
    <title>Post #1 by ianpiper</title>
    <dc:creator>ianpiper</dc:creator>
    <description><![CDATA[<p>Hi, <br />
<br />
I have come across a problem today and would appreciate some advice. I have a user who belongs to a client and I have given him &quot;All&quot; permissions to a particular project. I thought that having all permissions would mean that he would see the &quot;Delete&quot; link when he looks at a file listing. However he does not, and hence is unable to delete files that he has uploaded.<br />
<br />
I have not previously seen this because I use the service as admin and to be honest no-one else has ever wanted to delete a file before!<br />
<br />
So, can anyone enlighten me?<br />
<br />
Thanks,<br />
<br />
<br />
Ian.<br />
--</p>]]></description>
    <pubDate>Fri, 15 Jun 2007 17:24:55 UTC</pubDate>
  </item>
</channel>
</rss>