Fix resource access token bot namespace bug for admin users
What does this MR do and why?
Fixes an edge case where bot namespace was not assigned if the current user was an instance admin.
When a group or project access token is created, the bot user is tied to the creating namespace with the bot_namespace attribute. This fixes an edge case where bot_namespace was not allowed to be set when the current user was also an instance admin.
This bug would only affect GitLab.com and would not have manifested in production. However, it does cause confusion in GDK where a user testing .com behavior could also be a GDK instance admin. Even though this bug wouldn't affect production due to the way we use GitLab.com, admin and non-admin user creation should be aligned.
References
Please include cross links to any resources that are relevant to this MR. This will give reviewers and future readers helpful context to give an efficient review of the changes introduced.
- None
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
| Before | After |
|---|---|
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.