using Swarmops.Logic.Structure; namespace Swarmops.Logic.Security { public class Access { public readonly AccessAspect Aspect; public readonly Geography Geography; public readonly Organization Organization; public readonly 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 = AccessType.Write) { this.Organization = organization; this.Aspect = aspect; this.Type = type; } public Access(Organization organization, Geography geography, AccessAspect aspect, AccessType type = AccessType.Write) { this.Organization = organization; this.Geography = geography; this.Aspect = aspect; this.Type = type; } } public enum AccessAspect { Unknown = 0, /// /// Basic access to underlying ledgers /// Bookkeeping, /// /// Detailed access to underlying ledgers (documents, descriptions) /// BookkeepingDetails, /// /// Access to auditing working material (redflagged transactions, etc) /// Auditing, /// /// Access to regular accounting /// Financials, /// /// Access to send various correspondence, w/o necessarily knowing the recipients /// Correspondence, /// /// Access to personal details about people in an organization /// PersonalData, /// /// Access to the mere existence (photo, name) about people in an organization /// Participation, /// /// Access to change organization's fundamental operating parameters /// Administration, /// /// Access to this Swarmops installation and its operating parameters /// System, /// /// Null security: disable security checks entirely, like for Dashboard where each component rolls their own /// Null, /// /// Uniquely identified person (logged on) in a specific org. Write access means they can submit expense reports on their own behalf etc. /// Participant, /// /// Can enter received invoices, paper letters, etc. /// Secretarial, /// /// Access to personalized salary data (implies financial read access) /// Payroll } public enum AccessType { Unknown = 0, Read, Write } }