Skip to content

feat(*): set up permissions with shield

Yannis Barlas requested to merge permissions-setup into develop

This MR:

  • Adds @coko/server and by extension graphql-shield
  • Sets up shield permissions
  • Adds an auth object to the user graphql schema
  • Makes sure the sysAdmin team exists when the app is started with yarn start, and that the initial admin user is assigned to the team
  • Removes authsome for all practical purposes, but there's still some leftover boilerplate, as pubsweet server crashes with no authsome at all

Some secondary things:

  • I removed a lot of requires to specific models and replaced them with @pubsweet/models. It's cleaner and should work exactly the same way. In some cases where @pubsweet/model-user was required, it would have brought the original model from the pubsweet repositories and not the NCBI extension and that could lead to a broken state.
  • I deleted the organisationCreateService in favour of simply having a create method on the Organisation model.
  • organisation.teams now has its own resolver instead of using eager to fetch the teams.
Edited by Yannis Barlas

Merge request reports