Skip to content
代码片段 群组 项目
未验证 提交 cbd309ad 编辑于 作者: Julie Huang's avatar Julie Huang 提交者: GitLab
浏览文件

Use :manage_self_hosted_models_settings policy to manage visibility of...

Use :manage_self_hosted_models_settings policy to manage visibility of Self-hosted models pages in admin dashboard
上级 cfd61e51
No related branches found
No related tags found
无相关合并请求
......@@ -44,18 +44,13 @@ def insert_gilab_duo_menu
::Sidebars::Admin::Menus::CodeSuggestionsMenu.new(context)
)
return unless self_hosted_models_enabled?
return unless Ability.allowed?(context.current_user, :manage_self_hosted_models_settings)
insert_menu_after(
::Sidebars::Admin::Menus::CodeSuggestionsMenu,
::Sidebars::Admin::Menus::SelfHostedModelsMenu.new(context)
)
end
def self_hosted_models_enabled?
License.current&.ultimate? &&
GitlabSubscriptions::AddOnPurchase.for_duo_enterprise.active.exists?
end
end
end
end
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册