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

Release - Permissions system update and profiling improvements #858

Merged
merged 4 commits into from
Jul 8, 2024
Merged

Conversation

dancoates
Copy link
Contributor

No description provided.

dancoates added 4 commits July 4, 2024 14:30
it wasn't necessary, the app is already run separately through uvicorn
when deployed so it isn't trying to reload
Update metamist permissions system

Notable changes:

- Switch from just read/write permissions to defined roles
- Moved permissions from being defined on groups to being defined on projects to better reflect how they are being used.
- Moved permissions check helpers and methods out from the project table code and onto the `connection` so that they are available everywhere needed
- Made permissions checks faster by calculating access at the start of the request and then looking up an in memory map of permissions when checking. 
- Removed lots of slightly risky code that didn't check permissions in certain cases, now that permissions are fast we can always check them

commits: 

* add initial db migration for new project_groups table

* Update project based db connections

* update usage of project and group permission functions

* fix typo

* fix merge problems and circular import problems

* Update GraphQLFilters to fix generics for all_values method

* simplify migration, liquibase rollback support is shaky

So best to limit the destructive updates in the migration and do them manually

* Move project permission checks from project table to connection

This way they are accessible pretty much everywhere, but are only calculated once. The permission checks themselves are now synchronous and should be really fast, so no need for avoiding checking project ids

* Update graphql loaders and schema to work with new permissions

Also some QOL fixes for graphql types so that the context is now properly typed

* Update routes, layers and table files to work with new permissions

* add route to update project members

* update project table methods to incorporate admin group roles

Rather than having these roles separately - incorportate them into
project level roles where it makes sense. That way the same permission
constructs can be used for checking admin roles rather than having to
have separate ones.

* remove allow all access setting, it is better to use real controls

even when running locally, it is better to lean on the actual access
controls rather than allowing all access. This way we can catch issues
with permission checks during development

* change graphql project list to only list projects with certain roles

to avoid listing absolutely every project for users with admin roles

* fix data generation scripts to work with new permissions

* fix tests to work with new permissions structures

* fix merge issues

* update docs

* fix permission checks in project routes

* make query uppercase for consistency

* use test environment for tests

* make connection class variables protected

* add check for default user in generate data scripts

* fix linting errors

* simplify roles to allow better management from cpg-infrastructure

* re-reorder auth checks

* merge cleanup

* update seqr project listing to raise if user can't access all seqr projs

* Bump version: 7.1.1 → 7.2.0
@dancoates dancoates requested a review from illusional July 8, 2024 02:43
@dancoates dancoates merged commit dc25389 into main Jul 8, 2024
10 of 11 checks passed
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.

2 participants