Project

General

Profile

Patch #14318 » allow_watchers_and_contributers_access_to_issues.patch

Brett Patterson, 2013-06-19 22:13

View differences:

app/models/issue.rb (working copy)
when 'own'
user_ids = [user.id] + user.groups.map(&:id)
"(#{table_name}.author_id = #{user.id} OR #{table_name}.assigned_to_id IN (#{user_ids.join(',')}))"
when "own_watch"
user_ids = [user.id] + user.groups.map(&:id)
"(#{table_name}.author_id = #{user.id} OR #{table_name}.assigned_to_id IN (#{user_ids.join(',')}) OR #{table_name}.id IN (SELECT watchable_id FROM watchers WHERE user_id=#{user.id} AND watchable_type = 'Issue'))"
when "own_watch_contributed"
user_ids = [user.id] + user.groups.map(&:id)
"(#{table_name}.author_id = #{user.id} OR #{table_name}.assigned_to_id IN (#{user_ids.join(',')}) OR #{table_name}.id IN (SELECT watchable_id FROM watchers WHERE user_id=#{user.id} AND watchable_type = 'Issue') OR #{table_name}.id IN (SELECT journalized_id FROM journals where journalized_type = 'Issue' AND user_id=#{user.id} GROUP BY journalized_id))"
else
'1=0'
end
......
!self.is_private? || (self.author == user || user.is_or_belongs_to?(assigned_to))
when 'own'
self.author == user || user.is_or_belongs_to?(assigned_to)
when 'own_watch'
self.author == user || user.is_or_belongs_to?(assigned_to) || self.watched_by?(user)
when 'own_watch_contributed'
self.author == user || user.is_or_belongs_to?(assigned_to) || self.watched_by?(user) || self.journals.where('journalized_id = ?', self.id).where('user_id = ?', user).count > 0
else
false
end
app/models/role.rb (working copy)
ISSUES_VISIBILITY_OPTIONS = [
['all', :label_issues_visibility_all],
['default', :label_issues_visibility_public],
['own', :label_issues_visibility_own]
['own', :label_issues_visibility_own],
['own_watch', :label_issues_visibility_own_watch],
['own_watch_contributed', :label_issues_visibility_own_watch_contributed]
]
scope :sorted, order("#{table_name}.builtin ASC, #{table_name}.position ASC")
config/locales/en.yml (working copy)
setting_thumbnails_enabled: Display attachment thumbnails
setting_thumbnails_size: Thumbnails size (in pixels)
setting_non_working_week_days: Non-working days
setting_enable_watcher_issue_visibility: Enable watcher issue visibility
permission_add_project: Create project
permission_add_subprojects: Create subprojects
......
label_cross_project_tree: With project tree
label_cross_project_hierarchy: With project hierarchy
label_cross_project_system: With all projects
label_issues_visibility_own_watch: Issues created by, assigned to, or watched by the user
label_issues_visibility_own_watch_contributed: Issues created by, assigned to, watched by, or contributed to by the user
button_login: Login
button_submit: Submit
(1-1/15)