How to hide TeamCity configuration for selected users?
Asked Answered
C

2

9

I have one TeamCity project Dac.Test that contains 3 configurations: DEV, QA, PROD.

enter image description here

Also I have some users associated with their Roles. Is this possible to hide / show certains configurations for selected users or groups?

For example: Users associated with group: Testers can see QA configuration, but not PROD and DEV.

Cantone answered 24/4, 2013 at 13:58 Comment(6)
by hide, do you mean "prevent them from accessing in any way" or just "remove from view in the dashboard but if they look for it, they can find it"Cauchy
@Cauchy I mean "prevent them from accessing in any way".Cantone
dario, have you been able to resolve this?Laminated
@John Not really. None of solutions are applicable for me. As Mat said: this feature doesn't exist.Cantone
Ok, sorry we couldn't be of more help. If you're ever allowed more flexibility in how you manage your builds, I think you'll find that using project-based role management works well. Good luck!Laminated
I still can't believe this feature is not available in 2018 version as well. Can't think of a reason why this is not prioritized by their product team.Hooker
C
10

There is no way of managing user permissions per-build, this is available on a project level only. You could create a sub-project in the Dac.Test project to cater for this

If you're looking for a way of stopping people from mistakenly running this build, the following approach will work.

This method uses a prompt box that will pop up after you click the run button, it also needs input from the user confirming that they mean to run the build. No one can run this build by accident

  1. Go to your build configuration in the TeamCity UI
  2. From here, go to Edit Configuration Settings --> Parameters --> Add new parameter
  3. Enter something like 'Confirmation' as the parameter name
  4. Then beside 'Spec:', click the 'Edit...' button
  5. Set up the parameter as shown in the following screenshot:

enter image description here

You will now be prompted and asked for confirmation when you click the run button. The user will have to enter 'YES' in the prompt box that appears, any other value will stop the user from building: enter image description here

Crassus answered 21/1, 2015 at 12:20 Comment(0)
L
3

This is best accomplished by using TeamCity's built-in role management. Roles allow you to set fine-grained permissions for users and groups. One potential issue, however, is that roles are scoped to projects (not build configurations). You'll need to create a separate Dac.Test QA project+configuration and provide your Testers the necessary privileges there. You'll also need to make sure that they are stripped of all privileges for the Dac.Test project.

Laminated answered 24/4, 2013 at 14:24 Comment(8)
That's true. But unfortunatelly I can't separate my configurations that way.Cantone
Can you say more about that? Perhaps there's a way to work around it.Laminated
you can base them on a shared template that lives in a shared project then create builds from that template in protected projectsCauchy
I use a shared template across many projects so it is possibleCauchy
@Cauchy I learned something today -- thanks! I was always trying to create the build configuration in project B directly from the template in project A. But you have to first create an empty configuration in project B, and then associate it with the template in project A. Do I have that right?Laminated
@Mat I think that's not solve my problem or I miss something. I simply want to hide some configurations from the list. Configurations doesn't have something like "Permissions" - that what I need to introduce.Cantone
@Dario that feature doesn't exist, you need to put the configuration into separate projects and protect thoseCauchy
@JohnHoerr yes I think that works, you can also copy an existing configuration that uses the templateCauchy

© 2022 - 2024 — McMap. All rights reserved.