/// <summary> /// Creates a new chain of command permission. /// </summary> /// <param name="chainOfCommand"></param> /// <returns></returns> public ChainOfCommandPart HasChainOfCommand(ChainsOfCommand chainOfCommand) { if (ChainsOfCommandParts.Any(x => x.ChainOfCommand == chainOfCommand)) { throw new Exception("You may not declare access to a chain of command more than once for the same permission group."); } ChainsOfCommandParts.Add(new ChainOfCommandPart(chainOfCommand) { ParentPermissionGroup = this }); return(ChainsOfCommandParts.Last()); }
/// <summary> /// Creates a new chain of command permission. /// </summary> /// <param name="chainOfCommand"></param> public ChainOfCommandPart(ChainsOfCommand chainOfCommand) { ChainOfCommand = chainOfCommand; PropertyGroups = new List <PropertyGroupPart>(); }