debian-mirror-gitlab/app/channels/issues_channel.rb

14 lines
363 B
Ruby
Raw Normal View History

2020-05-24 23:13:21 +05:30
# frozen_string_literal: true
class IssuesChannel < ApplicationCable::Channel
def subscribed
project = Project.find_by_full_path(params[:project_path])
return reject unless project
issue = project.issues.find_by_iid(params[:iid])
return reject unless issue && Ability.allowed?(current_user, :read_issue, issue)
stream_for issue
end
end