diff options
Diffstat (limited to 'app/helpers/broadcast_messages_helper.rb')
-rw-r--r-- | app/helpers/broadcast_messages_helper.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/app/helpers/broadcast_messages_helper.rb b/app/helpers/broadcast_messages_helper.rb index 10cfa97030d..9827f075e54 100644 --- a/app/helpers/broadcast_messages_helper.rb +++ b/app/helpers/broadcast_messages_helper.rb @@ -77,11 +77,12 @@ module BroadcastMessagesHelper return unless current_user.present? strong_memoize(:current_user_access_level_for_project_or_group) do - if controller.is_a? Projects::ApplicationController + case controller + when Projects::ApplicationController next unless @project @project.team.max_member_access(current_user.id) - elsif controller.is_a? Groups::ApplicationController + when Groups::ApplicationController next unless @group @group.max_member_access_for_user(current_user) |