diff --git a/Site5/Automation/SwarmFunctions.aspx.cs b/Site5/Automation/SwarmFunctions.aspx.cs index a0a32231..a1c1a9a8 100644 --- a/Site5/Automation/SwarmFunctions.aspx.cs +++ b/Site5/Automation/SwarmFunctions.aspx.cs @@ -39,8 +39,22 @@ namespace Swarmops.Frontend.Automation { throw new UnauthorizedAccessException(); } - if (!authData.Authority.HasAccess (new Access (AccessAspect.Administration))) + if (position.PositionLevel == PositionLevel.SystemWide && !authData.Authority.HasAccess (new Access (AccessAspect.Administration))) { + // Authority check for systemwide + throw new UnauthorizedAccessException(); + } + if ((position.GeographyId == Geography.RootIdentity || position.GeographyId == 0) && + !authData.Authority.HasAccess (new Access (authData.CurrentOrganization, AccessAspect.Administration))) + { + // Authority check for org-global + throw new UnauthorizedAccessException(); + } + if ( + !authData.Authority.HasAccess (new Access (authData.CurrentOrganization, geography, + AccessAspect.Administration))) + { + // Authority check for org/geo combo throw new UnauthorizedAccessException(); } diff --git a/Site5/Pages/v5/Admin/OrgStaffing.aspx.cs b/Site5/Pages/v5/Admin/OrgStaffing.aspx.cs index 1afdad5b..90deb887 100644 --- a/Site5/Pages/v5/Admin/OrgStaffing.aspx.cs +++ b/Site5/Pages/v5/Admin/OrgStaffing.aspx.cs @@ -45,9 +45,9 @@ namespace Swarmops.Frontend.Pages.v5.Admin if (orgPositions.Count == 0) { - // not initalized. Initialize. + // not initalized. Initialize. Assume nonprofit. - Positions.CreateOrganizationDefaultPositions (CurrentOrganization); + Positions.CreateOrganizationDefaultPositions (CurrentOrganization, PositionTitle.Nonprofit); }