Commit b9d79d92 authored by Alexandre Delanoë's avatar Alexandre Delanoë

[INIT] user.

parent 8237d093
......@@ -39,17 +39,17 @@ issues.
### Initialization
Users has to be created first
1. stack ghci
2. runCmd insertUsersDemo
Users has to be created first (user1 is created as instance):
Then you can log in with user1:1resu
- stack install
- ~/.local/bin/gargantext-init "gargantext.ini"
## Use Cases
### Multi-User with Graphical User Interface (Server Mode)
~/.local/bin/stack --docker exec gargantext-server -- --ini "gargantext.ini" --run Prod
Then you can log in with user1:1resu
### Command Line Mode tools
......
......@@ -319,6 +319,20 @@ executables:
- base
- servant-server
gargantext-init:
main: Main.hs
source-dirs: bin/gargantext-init
ghc-options:
- -threaded
- -rtsopts
- -with-rtsopts=-N
- -O2
- -Wmissing-signatures
dependencies:
- gargantext
- base
tests:
# garg-test:
# main: Main.hs
......
......@@ -246,10 +246,9 @@ insertMasterDocs c lang hs = do
type CorpusName = Text
getOrMkRootWithCorpus :: (HasNodeError err, MkCorpus a)
=> Username -> Either CorpusName [CorpusId] -> Maybe a
-> Cmd err (UserId, RootId, CorpusId)
getOrMkRootWithCorpus username cName c = do
getOrMkRoot :: (HasNodeError err) => Username -> Cmd err (UserId, RootId)
getOrMkRoot username = do
maybeUserId <- getUser username
userId <- case maybeUserId of
Nothing -> nodeError NoUserFound
......@@ -264,7 +263,14 @@ getOrMkRootWithCorpus username cName c = do
False -> pure rootId'
rootId <- maybe (nodeError NoRootFound) pure (head rootId'')
pure (userId, rootId)
getOrMkRootWithCorpus :: (HasNodeError err, MkCorpus a)
=> Username -> Either CorpusName [CorpusId] -> Maybe a
-> Cmd err (UserId, RootId, CorpusId)
getOrMkRootWithCorpus username cName c = do
(userId, rootId) <- getOrMkRoot username
corpusId'' <- if username == userMaster
then do
ns <- getCorporaWithParentId rootId
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment