Security fix for ChangeOrg (re-enabling the page)

This commit is contained in:
Rick Falkvinge
2015-03-20 19:56:26 +01:00
parent 83bd32d984
commit 125360129d
3 changed files with 7 additions and 4 deletions
+3 -3
View File
@@ -9,20 +9,20 @@ namespace Swarmops.Logic.Security
public readonly Organization Organization;
public readonly AccessType Type;
public Access (AccessAspect aspect, AccessType type)
public Access (AccessAspect aspect, AccessType type = AccessType.Write) // Default to demanding r/w access unless r/o specified
{
this.Aspect = aspect;
this.Type = type;
}
public Access (Organization organization, AccessAspect aspect, AccessType type)
public Access (Organization organization, AccessAspect aspect, AccessType type = AccessType.Write)
{
this.Organization = organization;
this.Aspect = aspect;
this.Type = type;
}
public Access (Organization organization, Geography geography, AccessAspect aspect, AccessType type)
public Access(Organization organization, Geography geography, AccessAspect aspect, AccessType type = AccessType.Write)
{
this.Organization = organization;
this.Geography = geography;
+1 -1
View File
@@ -457,7 +457,7 @@ namespace Swarmops.Logic.Structure
FinancialAccounts[OrganizationFinancialAccountType.CostsInfrastructure] =
FinancialAccount.Create (this, "[LOC]Cost_IctInfrastructure", FinancialAccountType.Cost, null);
FinancialAccounts[OrganizationFinancialAccountType.CostsYearlyResult] =
FinancialAccount.Create (this, "[LOC]Cost_YearlyResult", FinancialAccountType.Cost, null);
FinancialAccount.Create (this, "[LOC]Cost_AnnualResult", FinancialAccountType.Cost, null);
FinancialAccounts[OrganizationFinancialAccountType.DebtsEquity] =
FinancialAccount.Create (this, "[LOC]Debt_Equity", FinancialAccountType.Debt, null);
FinancialAccounts[OrganizationFinancialAccountType.DebtsExpenseClaims] =
@@ -2,6 +2,7 @@
using System.Globalization;
using System.Web;
using System.Web.Security;
using Swarmops.Logic.Security;
using Swarmops.Logic.Structure;
namespace Swarmops.Frontend.Pages.v5.Security
@@ -15,6 +16,8 @@ namespace Swarmops.Frontend.Pages.v5.Security
throw new UnauthorizedAccessException ("No"); // may cause problems on login screen?
}
PageAccessRequired = new Access (AccessAspect.Null);
string returnUrlString = Request.QueryString["ReturnUrl"];
string organizationIdString = Request.QueryString["OrganizationId"];
int organizationId = Int32.Parse (organizationIdString);