8

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.

Dariusz
  • 12,358
  • 6
  • 46
  • 66
  • 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" – Matt Apr 24 '13 at 14:09
  • @Matt I mean "prevent them from accessing in any way". – Dariusz Apr 24 '13 at 14:16
  • dario, have you been able to resolve this? – John Hoerr Apr 29 '13 at 16:33
  • @John Not really. None of solutions are applicable for me. As Mat said: this feature doesn't exist. – Dariusz May 02 '13 at 08:24
  • 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! – John Hoerr May 02 '13 at 13:42
  • 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. – A.K.Desai Sep 09 '18 at 02:40

2 Answers2

9

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

ShaneC
  • 2,071
  • 2
  • 29
  • 52
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.

John Hoerr
  • 7,697
  • 2
  • 26
  • 39
  • That's true. But unfortunatelly I can't separate my configurations that way. – Dariusz Apr 24 '13 at 14:28
  • Can you say more about that? Perhaps there's a way to work around it. – John Hoerr Apr 24 '13 at 14:30
  • you can base them on a shared template that lives in a shared project then create builds from that template in protected projects – Matt Apr 24 '13 at 14:56
  • I use a shared template across many projects so it is possible – Matt Apr 24 '13 at 16:59
  • @Matt 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? – John Hoerr Apr 24 '13 at 17:16
  • @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. – Dariusz Apr 25 '13 at 10:45
  • 2
    @Dario that feature doesn't exist, you need to put the configuration into separate projects and protect those – Matt Apr 25 '13 at 10:52
  • @JohnHoerr yes I think that works, you can also copy an existing configuration that uses the template – Matt Apr 25 '13 at 10:53