mirror of
https://github.com/Start9Labs/registry.git
synced 2026-03-26 02:11:53 +00:00
fix logic ordering
This commit is contained in:
@@ -272,12 +272,12 @@ checkAdminAllowedPkgs pkgId adminId = do
|
|||||||
-- if pkg does not exist yet, allow, because authorized by whitelist
|
-- if pkg does not exist yet, allow, because authorized by whitelist
|
||||||
pkg <- runDB $ getPkgById (PkgRecordKey pkgId)
|
pkg <- runDB $ getPkgById (PkgRecordKey pkgId)
|
||||||
pkgExtracted <- runDB $ getPkgOnlyCreated (PkgRecordKey pkgId)
|
pkgExtracted <- runDB $ getPkgOnlyCreated (PkgRecordKey pkgId)
|
||||||
if length pkg > 0
|
if length pkgExtracted > 0
|
||||||
|
then pure (True, True)
|
||||||
|
else if length pkg > 0
|
||||||
then do
|
then do
|
||||||
res <- runDB $ getAllowedPkgs pkgId (AdminKey adminId)
|
res <- runDB $ getAllowedPkgs pkgId (AdminKey adminId)
|
||||||
pure $ if length res > 0 then (True, False) else (False, False)
|
pure $ if length res > 0 then (True, False) else (False, False)
|
||||||
else if length pkgExtracted > 0
|
|
||||||
then pure (True, True)
|
|
||||||
else pure (True, True)
|
else pure (True, True)
|
||||||
|
|
||||||
checkAdminAuth :: PkgId -> Handler (Bool, Text)
|
checkAdminAuth :: PkgId -> Handler (Bool, Text)
|
||||||
|
|||||||
Reference in New Issue
Block a user