Author ability to delete

Hi - wondering if there is any way to give general members to ability to delete their posts (messages, tasks, files etc). It seems they can edit, but only the admin has the ability to delete. I understand the desire to keep a record of all activity, but I think this is an important feature to be able to delete as well, if the admin assigns that privilege to a user.

Thanks for any info on how to do this - otherwise I will see about making a patch to do this.

Users need to be an admin in order to delete items.

If you want them to be able to delete their own messages, then amend application/models/project_messages/Message.class.php like so:

    /**
    * Check if specific user can delete this messages
    *
    * @access public
    * @param User $user
    * @return boolean
    */
    function canDelete(User $user) {
      if (!$user->isProjectUser($this->getProject())) {
        return false; // user is on project
      } // if

      if ($user->getId() == $this->getCreatedById() || $user->isAdministrator()) {
        return true; // user is administrator or they created this item
      } // if

      return false; // no no
    } // canDelete

If you are confident with php then you should have no problem finding & modifying other models to look like this.

Alex

Hi Alex,

Thanks for the change - I have implemented across all the models.

It would be great to see this as a permissions option for users in a future release.

Adrian