Skip to content

Commit

Permalink
refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmitriy Brodnitskiy committed Feb 19, 2013
1 parent 9e4ec9d commit a79bf8b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
2 changes: 1 addition & 1 deletion lib/patches/redmine_issues_helper_incognito_patch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def find_name_by_reflection_with_incognito(field, id)
project = Project.find(params[:id])
end

if User.current.allowed_to?(:no_show_names, project) && !User.current.admin? && params[:controller] = 'issues'||'projects'
if User.current.allowed_to?(:no_show_names, project) && !User.current.admin? && params[:controller] == 'issues'||params[:controller] == 'projects'
return record.roles_for_project(project).collect{|role| "#{role.name}" }.join(' ')
end
end
Expand Down
10 changes: 1 addition & 9 deletions lib/patches/redmine_user_incognito_patch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,12 @@ def link_to_user_with_incognito(user, options={})

if params[:controller] == 'issues'
project = params[:project_id] ? Project.find(params[:project_id]) : Issue.find(params[:id]).project
elsif params[:controller] == 'projects'
elsif params[:controller] == 'projects'|| params[:controller] == 'activities'
project = Project.find(params[:id])
end

if User.current.allowed_to?(:no_show_names, project)
case params[:controller]
when 'projects'
user.roles_for_project(project).collect{|role| "#{role.name}" }.join(' ')
when 'issues'
user.roles_for_project(project).collect{|role| "#{role.name}" }.join(' ')
else
'left controller'
end

else
link_to_user_without_incognito(user, options)
end
Expand Down

0 comments on commit a79bf8b

Please sign in to comment.