22 using System.Collections.Generic;
29 namespace Ntp.Analyzer.Config.Syntax
45 var fileUserName = Nodes.SingleOrDefault(n => n.Symbol ==
Symbol.KeywordUser) as StringSettingNode;
46 var groupName = Nodes.SingleOrDefault(n => n.Symbol ==
Symbol.KeywordGroup) as StringSettingNode;
57 (uint?) fileMode?.Value
66 if (appUserNameNode != null)
70 else if (appUserIdNode != null)
72 appUserId = (uint?) appUserIdNode.Value;
76 var fileUserIdNode = Nodes.SingleOrDefault(n => n.Symbol ==
Symbol.KeywordUser) as IntegerSettingNode;
77 var fileUserNameNode = Nodes.SingleOrDefault(n => n.Symbol ==
Symbol.KeywordUser) as StringSettingNode;
78 if (fileUserNameNode != null)
82 else if (fileUserIdNode != null)
84 fileUserId = (uint?) fileUserIdNode.Value;
88 var groupIdNode = Nodes.SingleOrDefault(n => n.Symbol ==
Symbol.KeywordGroup) as IntegerSettingNode;
89 var groupNameNode = Nodes.SingleOrDefault(n => n.Symbol ==
Symbol.KeywordGroup) as StringSettingNode;
90 if (groupNameNode != null)
94 else if (groupIdNode != null)
96 groupId = (uint?) groupIdNode.Value;
102 CheckIsUnique(
new List<Symbol>
113 CheckTypeIs<IntegerSettingNode, StringSettingNode>(
Symbol.KeywordExecUser);
114 CheckTypeIs<IntegerSettingNode, StringSettingNode>(
Symbol.KeywordUser);
115 CheckTypeIs<IntegerSettingNode, StringSettingNode>(
Symbol.KeywordGroup);
116 CheckTypeIs<IntegerSettingNode>(
Symbol.KeywordMode);
static uint GetGroupId(string groupName)
static uint GetUserId(string userName)
override PermissionConfiguration InternalCompile()
PermissionSyntaxNode(string name, int line)
override void ValidateTypes()
Override to validates the types in this syntax node.
override void InternalResolve(SymbolTable table)
override void ValidateMandatories()
Override to validates the mandatory types in this syntax node.