Enabled anonymous reading of org logos

This commit is contained in:
Rick Falkvinge
2019-03-02 18:06:34 +01:00
parent 4da24aa666
commit 23a66bd13f
+16 -5
View File
@@ -38,15 +38,26 @@ namespace Swarmops.Pages.v5.Support
bool hasPermission = false;
string serverFileName = document.ServerFileName;
if (document.UploadedByPersonId == this.CurrentAuthority.Person.Identity)
if (document.DocumentType == DocumentType.Logo)
{
hasPermission = true; // can always view documents you yourself uploaded
}
// Always allow organization logos to display,
// or the "signup" page won't work without
// credentials
if (CurrentOrganization.HasOpenLedgers)
{
hasPermission = true;
}
else
{
if (document.UploadedByPersonId == this.CurrentAuthority.Person.Identity)
{
hasPermission = true; // can always view documents you yourself uploaded
}
if (CurrentOrganization.HasOpenLedgers)
{
hasPermission = true;
}
}
if (!hasPermission)