summaryrefslogtreecommitdiffstats
path: root/app/models/attachment.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-12-10 20:09:41 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-12-10 20:09:41 +0000
commitef25210aca9278e51f81bd15e85a3143c667ff17 (patch)
tree312d20360571770a231f4fd307c12d0c535d60f2 /app/models/attachment.rb
parent2304f5d42c2bb1829b1cf9055c2848db116742d3 (diff)
downloadredmine-ef25210aca9278e51f81bd15e85a3143c667ff17.tar.gz
redmine-ef25210aca9278e51f81bd15e85a3143c667ff17.zip
Merged ajax_upload branch (#3957).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10977 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/attachment.rb')
-rw-r--r--app/models/attachment.rb12
1 files changed, 10 insertions, 2 deletions
diff --git a/app/models/attachment.rb b/app/models/attachment.rb
index a1c232d16..6fa079c91 100644
--- a/app/models/attachment.rb
+++ b/app/models/attachment.rb
@@ -154,11 +154,19 @@ class Attachment < ActiveRecord::Base
end
def visible?(user=User.current)
- container && container.attachments_visible?(user)
+ if container_id
+ container && container.attachments_visible?(user)
+ else
+ author == user
+ end
end
def deletable?(user=User.current)
- container && container.attachments_deletable?(user)
+ if container_id
+ container && container.attachments_deletable?(user)
+ else
+ author == user
+ end
end
def image?