Authority checks for org/geo combo
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user