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

environment and dataset teams missing GET_ORGANIZATION permission #1147

Open
zsaltys opened this issue Apr 5, 2024 · 1 comment · Fixed by #1139 · May be fixed by #1306
Open

environment and dataset teams missing GET_ORGANIZATION permission #1147

zsaltys opened this issue Apr 5, 2024 · 1 comment · Fixed by #1139 · May be fixed by #1306

Comments

@zsaltys
Copy link
Contributor

zsaltys commented Apr 5, 2024

There was recently a fix for 2.3 related to how GET_ORGANIZATION permission works: #1139

The summary of the issue is that if you are a member of an environment team or dataset team then you will not have GET_ORGANIZATION permission and that will cause multiple issues in data.all UI:

  • You will not be able to list environments in the environment UI and get an error saying that you do not have a GET_ORGANIZATION permission
  • You will see organizations in the Organizations list but if you try to view an organization you will not be able to view it (there won't even be a UI error and graphql response will contain an error. This should also be fixed).

The PR above partially fixes this issue by adding a new organization resolver which does not require a GET_ORGANIZATION permission. This means that anyone can view some basic information about any organization.

I argue that this fix is ultimately not the best one and the way it should work is this:

If you are a member of an environment team or any dataset team on that environment then you should be granted GET_ORGANIZATION permission on that organization implicitly even if your team is not directly invited into an organization. Logically this makes sense:

  1. You can only create environments with a specific environment team if that environment is invited to the organization (if that is not the case today then this should be fixed)
  2. We do not invite dataset teams into organizations because the only reason to invite teams into organizations is to let them create environments.

To summarize:

  1. Require that creating an environment in an organization with a team requires that that team is invited into the organization. This will ensure that this team will always have the GET_ORGANIZATION permission.
  2. Any dataset team when it is invited to an environment should also be at the same time given the GET_ORGANIZATION permission on the organization. It should be removed if the dataset team is removed from the environment.

Additionally we should add tests to check that dataset teams can view organizations or that they are granted GET_ORGANIZATION permission upon invitation. Also to make sure we test this for environment teams when they are invited to organizations.

@noah-paige noah-paige linked a pull request Apr 8, 2024 that will close this issue
@dlpzx dlpzx added this to To do in v2.6.0 via automation Apr 18, 2024
@dlpzx
Copy link
Contributor

dlpzx commented Apr 18, 2024

Thanks for the detailed issue. It's added to the list of possible candidates for 2.5

@SofiaSazonova SofiaSazonova self-assigned this May 14, 2024
@SofiaSazonova SofiaSazonova moved this from To do to In progress in v2.6.0 May 14, 2024
@SofiaSazonova SofiaSazonova moved this from In progress to Review in progress in v2.6.0 May 15, 2024
@SofiaSazonova SofiaSazonova linked a pull request May 15, 2024 that will close this issue
@SofiaSazonova SofiaSazonova linked a pull request May 31, 2024 that will close this issue
@SofiaSazonova SofiaSazonova linked a pull request May 31, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment