Hide Model Selection menus when Amazon Q is enabled
There is no need for anything model selection feature when AmazonQ is enabled for a an instance. Therefore we need to hide the following menus:
- Model Selection user default namespace: http://gdk.test:3000/-/profile/preferences
- Model Selection menu:
http://gdk.test:3000/groups/gitlab-duo/-/settings/gitlab_duo/model_selection
Implementation proposal:
These menu apperance in the page are ruled by policies. Find out what policies they use and add ::Ai::AmazonQ.connected?
clause to them.
You can change the following policies to achieve this:
-
:manage_instance_model_selection
at https://gitlab.com/gitlab-org/gitlab/blob/bfabf6c5c02222d58881b8dfbfd9081905d3a39f/ee/app/policies/ee/global_policy.rb#L196 -
:admin_group_model_selection
at https://gitlab.com/gitlab-org/gitlab/blob/6fc44432f79a350f2d732c2f67f9d8138e491e7e/ee/app/policies/ee/group_policy.rb#L1078 -
:assign_default_duo_group
at https://gitlab.com/gitlab-org/gitlab/blob/c2ef01544ec5ea8b8f74766bc2c982db2fc1db2c/ee/app/policies/ee/user_policy.rb#L51
Edited by Patrick Cyiza