Skip to content

Commit

Permalink
add user list back, but it is not great as it only looks at profileda…
Browse files Browse the repository at this point in the history
…ta nad not the lower level authentication backend.
  • Loading branch information
stepcut committed Apr 25, 2023
1 parent 0469369 commit 8600390
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
11 changes: 4 additions & 7 deletions Clckwrks/CLI/ProfileData.hs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module Clckwrks.CLI.ProfileData where
import Control.Applicative ((<$>), (<*>), (*>), pure)
import Clckwrks (UserId(..))
import Clckwrks.CLI.Core (CLIHandler(..))
import Clckwrks.ProfileData.Acid (ProfileDataState(..), GetProfileData(..), AddRole(..), RemoveRole(..))
import Clckwrks.ProfileData.Acid (ProfileDataState(..), GetProfileData(..), GetUserIdDisplayNames(..), AddRole(..), RemoveRole(..))
import Clckwrks.ProfileData.Types (Role(..))
import Control.Monad.Reader
import Data.Acid (AcidState)
Expand Down Expand Up @@ -48,7 +48,8 @@ main =
-}

data UserCmd
= UCShow UserId
= UCList
| UCShow UserId
| UCAddRole UserId Role
| UCRemoveRole UserId Role
deriving (Eq, Ord, Read, Show)
Expand All @@ -70,11 +71,9 @@ pUserId = UserId <$> (read <$> many1 digit)

pUserCmd :: Parser UserCmd
pUserCmd =
{-
do string "list"
return UCList
<|>
-}
do string "show"
skipMany1 space
u <- pUserId
Expand All @@ -95,13 +94,11 @@ pUserCmd =
return (UCRemoveRole u r)

execUserCommand :: UserCmd -> ReaderT (AcidState ProfileDataState) IO ()
{-
execUserCommand UCList =
do a <- ask
all <- query' a GetUserIdUsernames
all <- query' a GetUserIdDisplayNames
lift $ print all
return ()
-}
execUserCommand (UCShow uid) =
do a <- ask
pd <- query' a (GetProfileData uid)
Expand Down
2 changes: 1 addition & 1 deletion shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ let pkg = haskellPackages.callPackage
isLibrary = false;
isExecutable = true;
buildDepends = [
acid-state base clckwrks haskeline mtl network parsec cabal-install
acid-state base haskeline mtl network parsec cabal-install clckwrks
];
homepage = "http://www.clckwrks.com/";
description = "a command-line interface for adminstrating some aspects of clckwrks";
Expand Down

0 comments on commit 8600390

Please sign in to comment.