Commit 8761e73f authored by Alfredo Di Napoli's avatar Alfredo Di Napoli

Minor cleanup

parent fb894d00
Pipeline #4646 passed with stages
in 60 minutes and 25 seconds
......@@ -52,7 +52,7 @@ import Gargantext.API.Admin.Auth.Types
import Gargantext.API.Admin.EnvTypes (GargJob(..), Env)
import Gargantext.API.Admin.Orchestrator.Types (JobLog(..), AsyncJobs)
import Gargantext.API.Admin.Types
import Gargantext.API.Prelude (HasJoseError(..), joseError, HasServerError, GargServerC, GargServer, _ServerError, GargM, GargError (..), serverError)
import Gargantext.API.Prelude (HasJoseError(..), joseError, HasServerError, GargServerC, GargServer, _ServerError, GargM, GargError (..))
import Gargantext.Core.Mail (MailModel(..), mail)
import Gargantext.Core.Mail.Types (mailSettings)
import Gargantext.Core.Types.Individu (User(..), Username, GargPassword(..))
......@@ -150,8 +150,6 @@ withAccessM (AuthenticatedUser uId) (PathNodeNode cId docId) m = do
if True -- a && d
then m
else m -- serverError err401
withAccessM (AuthenticatedUser uId) (PathNodeOwner id) m = do
if uId == id then m else serverError err401
withAccess :: forall env err m api.
(GargServerC env err m, HasServer api '[]) =>
......
......@@ -107,10 +107,7 @@ instance Arbitrary AuthValid where
, u <- [1..3]
]
data PathId = PathNode NodeId
| PathNodeNode ListId DocId
-- | The captured NodeId must be exactly equal to the logged-in user's NodeId.
| PathNodeOwner NodeId
data PathId = PathNode NodeId | PathNodeNode ListId DocId
---------------------------
......
......@@ -79,6 +79,7 @@ data AccessCheck
| AC_master_user NodeId
-- | Always grant access, effectively a public route.
| AC_always_allow
-- | Always denies access.
| AC_always_deny
deriving (Show, Eq)
......
......@@ -3,10 +3,9 @@
module Gargantext.API.GraphQL.Node where
import Control.Monad.Except (lift)
import Data.Aeson
import Data.Either (Either(..))
import Data.Morpheus.Types ( GQLType )
import Data.Morpheus.Types ( GQLType, lift )
import Data.Text (Text)
import GHC.Generics (Generic)
import Gargantext.API.Admin.Auth.Types
......
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