diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2008-12-09 16:54:46 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2008-12-09 16:54:46 +0000 |
commit | 5d2899ee1b3e00d0cf43521182b1244dfc3cfe9f (patch) | |
tree | eb64711c0150fafb698da9d92eb0d6735a5461cf /app/models/attachment.rb | |
parent | 2b6e332318a3e0a9489d20280010bb2d00206d95 (diff) | |
download | redmine-5d2899ee1b3e00d0cf43521182b1244dfc3cfe9f.tar.gz redmine-5d2899ee1b3e00d0cf43521182b1244dfc3cfe9f.zip |
AttachmentsController now handles attachments deletion.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2116 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/attachment.rb')
-rw-r--r-- | app/models/attachment.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/app/models/attachment.rb b/app/models/attachment.rb index 3bcc266bc..2ba75a3fd 100644 --- a/app/models/attachment.rb +++ b/app/models/attachment.rb @@ -98,6 +98,14 @@ class Attachment < ActiveRecord::Base container.project end + def visible?(user=User.current) + container.attachments_visible?(user) + end + + def deletable?(user=User.current) + container.attachments_deletable?(user) + end + def image? self.filename =~ /\.(jpe?g|gif|png)$/i end |