2018-01-27 11:32:10 -05:00
|
|
|
module CalloutsHelper
|
|
|
|
def show_gke_cluster_integration_callout?(kube_feature_name, project)
|
2018-01-30 09:17:15 -05:00
|
|
|
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)
|
2018-01-29 18:08:27 -05:00
|
|
|
Callout.find_by(user: current_user, feature_name: feature_name)&.dismissed_state?
|
2018-01-27 11:32:10 -05:00
|
|
|
end
|
|
|
|
end
|