From 1c47128b2de495610a976909e5e887f7b06fd40e Mon Sep 17 00:00:00 2001 From: "Yann Esposito (Yogsototh)" Date: Sun, 28 Apr 2019 10:16:33 +0200 Subject: [PATCH] fix authorizations --- src/Aggreact/Authorization.hs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/Aggreact/Authorization.hs b/src/Aggreact/Authorization.hs index 8a8943e..67d71fd 100644 --- a/src/Aggreact/Authorization.hs +++ b/src/Aggreact/Authorization.hs @@ -98,11 +98,20 @@ scopeToStr :: Scope -> Text scopeToStr (Scope res acc) = res <> case acc of Read -> ":read"; Write -> ":write" readOnlyScopes :: [Text] -readOnlyScopes = [ "comment:read", "slug:read" ] +readOnlyScopes = [ "comment:read" + , "slug:read" ] + commentGrantedScopes :: [Text] -commentGrantedScopes = [ "comment:read", "slug:read" ] +commentGrantedScopes = [ "comment:read" + , "comment:write" + , "slug:read" ] + allScopes :: [Text] -allScopes = [ "admin", "comment:read", "comment:write", "slug:read", "slug:write" ] +allScopes = [ "admin" + , "comment:read" + , "comment:write" + , "slug:read" + , "slug:write" ] userScopes' :: AuthorizationStrategy -> Maybe User -> Scopes userScopes' Anybody Nothing =