Code builds with new Authority object; merging back to master
This commit is contained in:
@@ -41,7 +41,7 @@ namespace Swarmops.Frontend.Pages.v5.Ledgers
|
||||
throw new UnauthorizedAccessException ("All the nopes in the world");
|
||||
}
|
||||
|
||||
if (!CurrentUser.PositionAssignment.HasAccess (new Access (CurrentOrganization, AccessAspect.Bookkeeping, AccessType.Read), CurrentUser))
|
||||
if (!CurrentAuthority.HasAccess (new Access (CurrentOrganization, AccessAspect.Bookkeeping, AccessType.Read)))
|
||||
{
|
||||
throw new UnauthorizedAccessException ("Access denied because security tokens say so");
|
||||
}
|
||||
|
||||
@@ -114,8 +114,8 @@ namespace Swarmops.Frontend.Pages.v5.Ledgers
|
||||
(ExternalBankDataProfile) Session["LedgersResync" + guid + "Profile"];
|
||||
|
||||
if (
|
||||
!this._authenticationData.CurrentUser.PositionAssignment.HasAccess (new Access (
|
||||
this._authenticationData.CurrentOrganization, AccessAspect.Bookkeeping, AccessType.Read), this._authenticationData.CurrentUser))
|
||||
!this._authenticationData.Authority.HasAccess (new Access (
|
||||
this._authenticationData.CurrentOrganization, AccessAspect.Bookkeeping, AccessType.Read)))
|
||||
{
|
||||
throw new UnauthorizedAccessException();
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace Swarmops.Frontend.Pages.v5.Ledgers
|
||||
List<string> rows = new List<string>();
|
||||
|
||||
if (
|
||||
CurrentUser.PositionAssignment.HasAccess (new Access (CurrentOrganization, AccessAspect.BookkeepingDetails, AccessType.Read), CurrentUser))
|
||||
CurrentAuthority.HasAccess (new Access (CurrentOrganization, AccessAspect.BookkeepingDetails, AccessType.Read)))
|
||||
{
|
||||
foreach (FinancialTransaction transaction in unbalancedTransactions)
|
||||
{
|
||||
|
||||
@@ -156,8 +156,8 @@ namespace Swarmops.Frontend.Pages.v5.Ledgers
|
||||
FinancialAccount account = FinancialAccount.FromIdentity (accountId);
|
||||
|
||||
if (account.Organization.Identity != authData.CurrentOrganization.Identity ||
|
||||
!authData.CurrentUser.PositionAssignment.HasAccess (new Access (authData.CurrentOrganization, AccessAspect.Bookkeeping,
|
||||
AccessType.Write), authData.CurrentUser))
|
||||
!authData.Authority.HasAccess (new Access (authData.CurrentOrganization, AccessAspect.Bookkeeping,
|
||||
AccessType.Write)))
|
||||
{
|
||||
throw new UnauthorizedAccessException();
|
||||
}
|
||||
@@ -177,8 +177,8 @@ namespace Swarmops.Frontend.Pages.v5.Ledgers
|
||||
AuthenticationData authenticationData = GetAuthenticationDataAndCulture();
|
||||
|
||||
if (
|
||||
!authenticationData.CurrentUser.PositionAssignment.HasAccess (new Access (authenticationData.CurrentOrganization,
|
||||
AccessAspect.Bookkeeping, AccessType.Write), authenticationData.CurrentUser))
|
||||
!authenticationData.Authority.HasAccess (new Access (authenticationData.CurrentOrganization,
|
||||
AccessAspect.Bookkeeping, AccessType.Write)))
|
||||
{
|
||||
throw new UnauthorizedAccessException();
|
||||
}
|
||||
|
||||
@@ -229,8 +229,8 @@ namespace Swarmops.Site.Pages.Ledgers
|
||||
FinancialAccount account = FinancialAccount.FromIdentity (accountId);
|
||||
|
||||
if (account.Organization.Identity != authData.CurrentOrganization.Identity ||
|
||||
!authData.CurrentUser.PositionAssignment.HasAccess (new Access (authData.CurrentOrganization, AccessAspect.Bookkeeping,
|
||||
AccessType.Write), authData.CurrentUser))
|
||||
!authData.Authority.HasAccess (new Access (authData.CurrentOrganization, AccessAspect.Bookkeeping,
|
||||
AccessType.Write)))
|
||||
{
|
||||
throw new UnauthorizedAccessException();
|
||||
}
|
||||
|
||||
@@ -78,8 +78,8 @@ namespace Swarmops.Pages.v5.Support
|
||||
// TODO: Security leak - check CurrentOrganization against Document's org
|
||||
|
||||
if (
|
||||
CurrentUser.PositionAssignment.HasAccess (new Access (CurrentOrganization, AccessAspect.Financials,
|
||||
AccessType.Write), CurrentUser))
|
||||
CurrentAuthority.HasAccess (new Access (CurrentOrganization, AccessAspect.Financials,
|
||||
AccessType.Write)))
|
||||
{
|
||||
hasPermission = true;
|
||||
}
|
||||
|
||||
@@ -20,8 +20,8 @@ namespace Swarmops.Frontend.Pages.Swarm
|
||||
Geography geography = Geography.FromIdentity (geographyId);
|
||||
|
||||
if (
|
||||
!CurrentUser.PositionAssignment.HasAccess (new Access (CurrentOrganization, geography, AccessAspect.PersonalData,
|
||||
AccessType.Read), CurrentUser))
|
||||
!CurrentAuthority.HasAccess (new Access (CurrentOrganization, geography, AccessAspect.PersonalData,
|
||||
AccessType.Read)))
|
||||
{
|
||||
throw new UnauthorizedAccessException ("nope");
|
||||
}
|
||||
|
||||
@@ -51,8 +51,8 @@ namespace Swarmops.Frontend.Pages.Swarm
|
||||
AuthenticationData authData = GetAuthenticationDataAndCulture();
|
||||
|
||||
if (
|
||||
!authData.CurrentUser.PositionAssignment.HasAccess (new Access (authData.CurrentOrganization, AccessAspect.Financials,
|
||||
AccessType.Write), authData.CurrentUser))
|
||||
!authData.Authority.HasAccess (new Access (authData.CurrentOrganization, AccessAspect.Financials,
|
||||
AccessType.Write)))
|
||||
{
|
||||
throw new SecurityAccessDeniedException ("Insufficient privileges for operation");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user