fix authorizations

This commit is contained in:
Yann Esposito (Yogsototh) 2019-04-28 10:16:33 +02:00
parent 046d0f1fe5
commit 1c47128b2d
Signed by untrusted user who does not match committer: yogsototh
GPG key ID: 7B19A4C650D59646

View file

@ -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 =