Renamed enums
This commit is contained in:
@@ -14,13 +14,13 @@ namespace Swarmops.Common.Enums
|
||||
public enum PositionLevel
|
||||
{
|
||||
Unknown = 0,
|
||||
Systemwide = 10,
|
||||
OrganizationwideDefault = 20,
|
||||
Organizationwide = 30,
|
||||
OrganizationTop = 40,
|
||||
SystemWide = 10,
|
||||
OrganizationWideDefaultUnused = 20,
|
||||
OrganizationStrategic = 30,
|
||||
OrganizationExecutive = 40,
|
||||
GeographyDefault = 50,
|
||||
SuborganizationwideDefault = 60,
|
||||
SuborganizationTopDefault = 70,
|
||||
SuborganizationStrategicDefault = 60,
|
||||
SuborganizationExecutiveDefault = 70,
|
||||
SuborganizationGeographyDefault = 80,
|
||||
Geography = 90
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ namespace Swarmops.Logic.Security
|
||||
_data.PositionAssignmentId = (assignment == null ? 0 : assignment.Identity);
|
||||
if (assignment != null)
|
||||
{
|
||||
if (assignment.Position.PositionLevel != PositionLevel.Systemwide)
|
||||
if (assignment.Position.PositionLevel != PositionLevel.SystemWide)
|
||||
{
|
||||
_data.OrganizationId = assignment.Position.OrganizationId;
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace Swarmops.Logic.Swarm
|
||||
PositionTitle positionTitle, bool volunteerable, bool overridable, Position reportsTo, Position dotReportsTo,
|
||||
int minCount, int maxCount)
|
||||
{
|
||||
if (level != PositionLevel.Systemwide)
|
||||
if (level != PositionLevel.SystemWide)
|
||||
{
|
||||
throw new ArgumentException (
|
||||
"Can only create system-wide positions (e.g. sysadmin) with this organizationless Position.Create() version.");
|
||||
@@ -56,7 +56,7 @@ namespace Swarmops.Logic.Swarm
|
||||
|
||||
int positionId = SwarmDb.GetDatabaseForWriting()
|
||||
.CreatePosition(
|
||||
PositionLevel.Systemwide, 0 /*organizationId*/, 0 /* geographyId */, 0 /*overridesHigherId */,
|
||||
PositionLevel.SystemWide, 0 /*organizationId*/, 0 /* geographyId */, 0 /*overridesHigherId */,
|
||||
createdByPerson == null? 0: createdByPerson.Identity, createdByPosition == null? 0: createdByPosition.Identity,
|
||||
positionType.ToString(), positionTitle.ToString(),
|
||||
false /*inheritsDownward*/, volunteerable, overridable,
|
||||
|
||||
@@ -57,8 +57,8 @@ namespace Swarmops.Logic.Swarm
|
||||
{
|
||||
int organizationId = 0;
|
||||
|
||||
if (position.PositionLevel != PositionLevel.OrganizationwideDefault &&
|
||||
position.PositionLevel != PositionLevel.Systemwide)
|
||||
if (position.PositionLevel != PositionLevel.OrganizationWideDefaultUnused &&
|
||||
position.PositionLevel != PositionLevel.SystemWide)
|
||||
{
|
||||
organizationId = organization.Identity; // can't be null in these cases
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace Swarmops.Logic.Swarm
|
||||
{
|
||||
public static Positions ForSystem()
|
||||
{
|
||||
return FromArray(SwarmDb.GetDatabaseForReading().GetPositions (PositionLevel.Systemwide));
|
||||
return FromArray(SwarmDb.GetDatabaseForReading().GetPositions (PositionLevel.SystemWide));
|
||||
}
|
||||
|
||||
public PositionAssignments Assignments
|
||||
@@ -40,13 +40,13 @@ namespace Swarmops.Logic.Swarm
|
||||
|
||||
// Ok, so there are zero system-level positions. Create the Sysadmin positions.
|
||||
|
||||
Position sysadminPrincipal = Position.Create (PositionLevel.Systemwide, null /* createdByPerson*/, null /*createdByPosition*/, PositionType.System_SysadminMain,
|
||||
Position sysadminPrincipal = Position.Create (PositionLevel.SystemWide, null /* createdByPerson*/, null /*createdByPosition*/, PositionType.System_SysadminMain,
|
||||
PositionTitle.Default, false /*volunteerable*/, false /*overridable*/, null /*reportsTo*/, null /*dotReportsTo*/, 1 /*minCount*/, 1 /*maxCount*/);
|
||||
|
||||
Position.Create(PositionLevel.Systemwide, null /* createdByPerson*/, null /*createdByPosition*/, PositionType.System_SysadminReadWrite, PositionTitle.Default,
|
||||
Position.Create(PositionLevel.SystemWide, null /* createdByPerson*/, null /*createdByPosition*/, PositionType.System_SysadminReadWrite, PositionTitle.Default,
|
||||
false, false, sysadminPrincipal, null /*dotReportsTo*/, 0 /*minCount*/, 0 /*maxCount*/);
|
||||
|
||||
Position.Create(PositionLevel.Systemwide, null /* createdByPerson*/, null /*createdByPosition*/, PositionType.System_SysadminAssistantReadOnly, PositionTitle.Default,
|
||||
Position.Create(PositionLevel.SystemWide, null /* createdByPerson*/, null /*createdByPosition*/, PositionType.System_SysadminAssistantReadOnly, PositionTitle.Default,
|
||||
false, false, sysadminPrincipal, null /*dotReportsTo*/, 0 /*minCount*/, 0 /*maxCount*/);
|
||||
|
||||
// If there's exactly one person in the system, we're undergoing Setup, so assign to Sysadmin Principal position.
|
||||
|
||||
@@ -13,10 +13,6 @@ namespace Swarmops.Logic.Swarm
|
||||
{
|
||||
public static Roles FromArray (BasicPersonRole[] basicArray)
|
||||
{
|
||||
// This should never run anymore, so throw.
|
||||
|
||||
throw new NotImplementedException();
|
||||
|
||||
Roles result = new Roles();
|
||||
|
||||
result.Capacity = basicArray.Length*11/10;
|
||||
|
||||
Reference in New Issue
Block a user