AI actions are shown to users without permissions

Steps to reproduce

  • open new issue on GitLab project without being project member

Example Project

https://gitlab.com/gitlab-org/gitlab/-/issues/new

What is the current bug behavior?

AI actions button is shown and modal opens when clicked but AI action fails due to missing permission:

screenshot of AI actions modal and error message

What is the expected correct behavior?

hide AI actions from users without sufficient permission