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

Lab project: Test for team membership #25

Open
achilleas-k opened this issue Oct 2, 2020 · 7 comments
Open

Lab project: Test for team membership #25

achilleas-k opened this issue Oct 2, 2020 · 7 comments
Labels
labproject The research project manager micro-tonic

Comments

@achilleas-k
Copy link
Member

If a user specifies a team for the new project and they're not a member, the creation should fail.
This requires an API endpoint for retrieving a list of members for a team, or a list of teams that a user is a member of.

@achilleas-k achilleas-k added the labproject The research project manager micro-tonic label Oct 2, 2020
@jcolomb
Copy link
Collaborator

jcolomb commented Oct 2, 2020

Indeed, the best would be a dropdown menu of teams he is part of (so the user cannot specify a team is not in).

@jcolomb
Copy link
Collaborator

jcolomb commented Oct 2, 2020

Unfortunately, testing a user for team membership isn't supported by the GIN API currently

Since the organisation is specified first, one can get member lists for all teams of the orga.
GET /orgs/:orgname/teams
then get member list for each team:
GET /admin/teams/:teamid/members

and then check whether the user is part of each team. (it seems one needs admin rights at the moment ?)

This way, there is no need to work the gogs API.

@achilleas-k
Copy link
Member Author

Right, I misspoke (typed): The API endpoint exists, but it's not exposed in the client.

Indeed, the best would be a dropdown menu of teams he is part of (so the user cannot specify a team is not in).

But then there wouldn't be a way to specify a new team name. So we need a free text field, which allows specification of an existing team.

There's also another issue: The forms, in their current state, are static (once rendered), so we can't change the team list after the org is selected. It would be possible, but I don't want to overcomplicate things. Currently, the Team entry is a free text field with suggestions from the team list of all the organisations that the user belongs to.

@achilleas-k
Copy link
Member Author

Right, I misspoke (typed): The API endpoint exists, but it's not exposed in the client.

To clarify, I'd like to add the entry in the client rather than hack around it in the microservice.

@jcolomb
Copy link
Collaborator

jcolomb commented Oct 2, 2020

I am wondering if we should not abandon the idea for the first version and implement it nicely later.
Having a "hack-looking" team name entry may make things more complicated and disturb the users.
?

(it also looks like doing some work to get a working but messy function, because we do not have the time to create the full featured version, while the latter will not use the functions we create for the messy function...)

@achilleas-k
Copy link
Member Author

We could. Let's keep it in the code. It can be disabled with a single line change later when we finally deploy it if we're not happy and then it will fall back to using the project name.

@achilleas-k
Copy link
Member Author

Issue will be solvable once gogs/go-gogs-client#121 is merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
labproject The research project manager micro-tonic
Projects
None yet
Development

No branches or pull requests

2 participants