update backend default permissions to non-OwnProfile

This commit is contained in:
Saku Laesvuori 2024-01-31 14:46:13 +02:00
parent c73f94bcd9
commit 59205df9d9
Signed by: slaesvuo
GPG Key ID: 257D284A2A1D3A32
1 changed files with 3 additions and 1 deletions

View File

@ -214,7 +214,9 @@ instance MonadRandom APIM where
instance MonadPermissions APIM where
currentPermissions = asks statePermissions
defaultPermissions = pure $ Permissions $ fromList [(OwnProfile, ReadWrite)]
defaultPermissions =
maybe mempty (\user -> Permissions $ fromList [(Profile user, ReadWrite)]) <$>
asks stateCurrentUser
runAPIM :: Config -> APIM a -> IO a
runAPIM config (APIM m) = runReaderT m RequestState