Patch #8109 ยป acts_as_attachable.rb.patch
| acts_as_attachable.rb 2011-03-11 23:35:58.000000000 +0200 | ||
|---|---|---|
|
end
|
||
|
|
||
|
def attachments_visible?(user=User.current)
|
||
|
user.allowed_to?(self.class.attachable_options[:view_permission], self.project)
|
||
|
if self.project
|
||
|
user.allowed_to?(self.class.attachable_options[:view_permission], self.project)
|
||
|
else
|
||
|
user.allowed_to?(self.class.attachable_options[:view_permission], nil, :global => true)
|
||
|
end
|
||
|
end
|
||
|
|
||
|
def attachments_deletable?(user=User.current)
|
||
|
user.allowed_to?(self.class.attachable_options[:delete_permission], self.project)
|
||
|
if self.project
|
||
|
user.allowed_to?(self.class.attachable_options[:delete_permission], self.project)
|
||
|
else
|
||
|
user.allowed_to?(self.class.attachable_options[:delete_permission], nil, :global => true)
|
||
|
end
|
||
|
end
|
||
|
def initialize_unsaved_attachments
|
||