Refactor `UserId` and `ContextId` to have their own types
Fixes #276 (closed).
I have refactored the code so that UserId
is now a newtype, and I think that my refactoring led to to fix most of what originally reported as part of #277 ( heads up to @cgenie , we might not need to fix that ticket after all).
As I was at it, I have given also the ContextId
its own type, as I have seen in the DB that we have certain tables where the context_id
is stored separately, so it feels wrong to collate it to a NodeId
, but in some places in Gargantext I had to perform explicit conversion, which might want to audit at some point.
Last but not least now an AuthenticatedUser
stores a UserId
as well, which means we can finally run more sophisticated policy checks (including the one on user_infos
in GQL which was failing originally).