Merge pull request #3390 from linki/release/4.2

[fix] perm might be nil. in that case just ignore it.
pull/3399/head
Markus Kahl 9 years ago
commit d3286d4747
  1. 4
      lib/plugins/acts_as_activity_provider/lib/acts_as_activity_provider.rb

@ -191,13 +191,13 @@ module Redmine
allowed_projects = []
user.projects_by_role.each do |role, projects|
allowed_projects << projects.map(&:id) if role.allowed_to?(perm.name)
allowed_projects << projects.map(&:id) if perm && role.allowed_to?(perm.name)
end
stmt = projects_table[:id].in(allowed_projects.uniq)
end
if (Role.anonymous.allowed_to?(perm.name) || Role.non_member.allowed_to?(perm.name)) && !is_member
if perm && (Role.anonymous.allowed_to?(perm.name) || Role.non_member.allowed_to?(perm.name)) && !is_member
public_project = projects_table[:is_public].eq(true)
stmt = stmt ? stmt.or(public_project) : public_project

Loading…
Cancel
Save