possibly use the activity permissions in the fetcher to find visible event types

pull/351/head
Tim Felgentreff 14 years ago
parent d34abea14e
commit 75024acf5a
  1. 10
      lib/redmine/activity/fetcher.rb

@ -38,7 +38,15 @@ module Redmine
return @event_types unless @event_types.nil?
@event_types = Redmine::Activity.available_event_types
@event_types = @event_types.select {|o| @user.allowed_to?("view_#{o}".to_sym, @project)} if @project
@event_types = @event_types.select do |o|
permissions = constantized_providers(o).collect do |p|
p.activity_provider_options[o].try(:[], :permission)
end.compact
if @project
return @user.allowed_to?("view_#{o}".to_sym, @project) if permissions.blank?
permissions.all? {|p| @user.allowed_to?(p, @project) } if @project
end
end
@event_types
end

Loading…
Cancel
Save