feat(*): set up permissions with shield
This MR:
- Adds
@coko/server
and by extensiongraphql-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 withyarn 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 acreate
method on theOrganisation
model. -
organisation.teams
now has its own resolver instead of usingeager
to fetch the teams.