Security fix for ChangeOrg (re-enabling the page)
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user