Storage: add global resources/system (#53000)

Co-authored-by: nmarrs <nathanielmarrs@gmail.com>
This commit is contained in:
Artur Wierzbicki
2022-07-29 23:58:47 +04:00
committed by GitHub
parent 27709adac3
commit 08dabfaffc
3 changed files with 38 additions and 25 deletions

View File

@@ -40,8 +40,8 @@ const brandingStorage = "branding"
const SystemBrandingStorage = "system/" + brandingStorage
var (
SystemBrandingReader = &models.SignedInUser{OrgId: 1}
SystemBrandingAdmin = &models.SignedInUser{OrgId: 1}
SystemBrandingReader = &models.SignedInUser{OrgId: ac.GlobalOrgID}
SystemBrandingAdmin = &models.SignedInUser{OrgId: ac.GlobalOrgID}
)
const MAX_UPLOAD_SIZE = 1 * 1024 * 1024 // 3MB
@@ -179,6 +179,8 @@ func ProvideService(
return storages
}
globalRoots = append(globalRoots, initializeOrgStorages(ac.GlobalOrgID)...)
authService := newStaticStorageAuthService(func(ctx context.Context, user *models.SignedInUser, storageName string) map[string]filestorage.PathFilter {
// Public is OK to read regardless of user settings
if storageName == RootPublicStatic {