Skip to content

Add ACLs on Farms

Erwan Rouchet requested to merge farm-acl into master

Closes #1621 (closed)

  • There is no data migration, so everyone loses access to all farms.

  • Process.run no longer sets the default farm automatically, meaning a lot of unrelated tests had to be updated and all endpoints that start or retry processes need to handle the farm themselves.

  • CreateTrainingProcess, CreateFilesProcess and CreateS3Import now all support a farm_id field. We may need to add a farm selection field in the frontend later, otherwise a user that does not have access to the default farm will be stuck.

  • Git repository imports will fail if whoever owns the OAuthCredentials of the repository does not have access to the default farm.

  • When no default farm is set in the settings (which is the case during unit tests), get_default_farm() returned the first farm in any order, meaning any random farm. I updated it so it returns the first farm alphabetically so that unit tests could run properly.

  • I updated the FixtureTestCase so it would properly cleanup all caches in both tests and subtests, to reduce intermittent failures or changes in the number of queries depending on how you run the tests.

  • I struggled for a while with file imports, as the API is quite complicated. I ended up rewriting the code that starts file imports, moving it from the APIView to the serializer, so that it starts to look a little bit more like the other endpoints. It still has quite a bunch of tech debt.

Merge request reports

Loading