gitlab-org--gitlab-foss/app/helpers/callouts_helper.rb

14 lines
386 B
Ruby
Raw Normal View History

2018-01-27 11:32:10 -05:00
module CalloutsHelper
def show_gke_cluster_integration_callout?(kube_feature_name, project)
current_user && !user_dismissed?(kube_feature_name) &&
(project.team.master?(current_user) ||
current_user == project.owner)
2018-01-27 11:32:10 -05:00
end
private
def user_dismissed?(feature_name)
Callout.find_by(user: current_user, feature_name: feature_name)&.dismissed_state?
2018-01-27 11:32:10 -05:00
end
end