Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for TeamCity Role Assignments for User Groups #86

Merged
merged 3 commits into from
May 29, 2020

Conversation

justinto-guidewire
Copy link
Contributor

Implemented the following REST API's

  • POST /app/rest/userGroups/{groupLocator}/roles/{roleId}/{scope}
  • DELETE /app/rest/userGroups/{groupLocator}/roles/{roleId}/{scope}
  • GET /app/rest/userGroups/{groupLocator}/roles/{roleId}/{scope}
  • GET /app/rest/userGroups/{groupLocator}/roles

Ccrockatt and others added 2 commits May 12, 2020 13:28
@cvbarros
Copy link
Owner

This is an awesome feature!

Before moving forward with further work to get this merged, I'd like to take a moment and discuss the API design around Users/Groups/Roles:

My proposal is that instead of relying on a service for GroupRoleAssignment, specific to managing roles for group, we flip the switch a bit and design a more general, discoverable and stable approach for these operations.

Seeing from the API docs and UI features, Roles can be assigned to either Users or Groups.

However, don't think we'll be able to manage the roles themselves anytime soon via the REST API. Existing upstream issue has been around for quite some time: https://youtrack.jetbrains.com/issue/TW-37581

In that sense, I'd say we could have a RoleAssignmentService in which we could use to manage roles for both users and groups, what do you think?

@justinto-guidewire
Copy link
Contributor Author

Hi @cvbarros, I think that's a great idea, and looking at the API for users and groups, it's similar enough that we can just implement both at the same time.

We'll refactor this a little bit and update this PR, along with the terraform provider one as well.

@justinto-guidewire
Copy link
Contributor Author

justinto-guidewire commented May 20, 2020

@cvbarros, unfortunately, the Users API is not implemented yet, so we didn't implement the role assignment for users also. Maybe we can do that in another PR later on.

Please let us know if the latest commit is inline with what you had in mind. Thanks!

Copy link
Owner

@cvbarros cvbarros left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! Thanks for this 🙇 💯

@cvbarros cvbarros merged commit 710a4d5 into cvbarros:master May 29, 2020
@cvbarros cvbarros added this to the v1.2.0 milestone May 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants