Beispiel #1
0
 public PolicyData(
     string name,
     string group,
     string description,
     IClientData clientData,
     string typeName,
     string methodName,
     BindingFlags bindingFlags,
     MethodFlags methodFlags,
     PolicyFlags policyFlags,
     IPlugin plugin,
     long token
     )
 {
     this.kind         = IdentifierKind.PolicyData;
     this.id           = AttributeOps.GetObjectId(this);
     this.name         = name;
     this.group        = group;
     this.description  = description;
     this.clientData   = clientData;
     this.typeName     = typeName;
     this.methodName   = methodName;
     this.bindingFlags = bindingFlags;
     this.methodFlags  = methodFlags;
     this.policyFlags  = policyFlags;
     this.plugin       = plugin;
     this.token        = token;
 }
Beispiel #2
0
        ///////////////////////////////////////////////////////////////////////////////////////

        #region Static "Factory" Methods
        public static ScriptPolicy Create(
            PolicyFlags flags,
            Type commandType,
            long commandToken,
            Interpreter policyInterpreter,
            string text
            )
        {
            return(new ScriptPolicy(
                       flags, commandType, commandToken, policyInterpreter, text));
        }
Beispiel #3
0
 private ScriptPolicy(
     PolicyFlags flags,
     Type commandType,
     long commandToken,
     Interpreter policyInterpreter,
     string text
     )
 {
     this.flags             = flags;
     this.commandType       = commandType;
     this.commandToken      = commandToken;
     this.policyInterpreter = policyInterpreter;
     this.text = text;
 }
Beispiel #4
0
        ///////////////////////////////////////////////////////////////////////

        public static bool HasFlags(
            PolicyFlags flags,
            PolicyFlags hasFlags,
            bool all
            )
        {
            if (all)
            {
                return((flags & hasFlags) == hasFlags);
            }
            else
            {
                return((flags & hasFlags) != PolicyFlags.None);
            }
        }
Beispiel #5
0
        ///////////////////////////////////////////////////////////////////////

        private PolicyContext(
            PolicyFlags flags,
            AssemblyName assemblyName,
            string typeName,
            IExecute execute,
            ArgumentList arguments,
            IScript script,
            string fileName,
            byte[] bytes,
            string text,
            Encoding encoding,
            byte[] hashValue,
            string hashAlgorithmName,
            IClientData clientData,
            IPlugin plugin,
            PolicyDecision originalDecision
            )
            : this()
        {
            this.flags             = flags;
            this.assemblyName      = assemblyName;
            this.typeName          = typeName;
            this.execute           = execute;
            this.arguments         = arguments;
            this.script            = script;
            this.fileName          = fileName;
            this.bytes             = bytes;
            this.text              = text;
            this.encoding          = encoding;
            this.hashValue         = hashValue;
            this.hashAlgorithmName = hashAlgorithmName;
            this.clientData        = clientData;
            this.plugin            = plugin;
            this.originalDecision  = originalDecision;

            //
            // NOTE: *WARNING* Take the original decision into account.  With
            //       the current logic, if the original decision is "denied"
            //       then any later votes do not matter.
            //
            Vote(this.originalDecision);
        }
Beispiel #6
0
        ///////////////////////////////////////////////////////////////////////

        #region Static "Factory" Members
        public static PolicyContext Create(
            PolicyFlags flags,
            AssemblyName assemblyName,
            string typeName,
            IExecute execute,
            ArgumentList arguments,
            IScript script,
            string fileName,
            byte[] bytes,
            string text,
            Encoding encoding,
            byte[] hashValue,
            string hashAlgorithmName,
            IClientData clientData,
            IPlugin plugin,
            PolicyDecision originalDecision
            )
        {
            return(new PolicyContext(
                       flags, assemblyName, typeName, execute, arguments, script,
                       fileName, bytes, text, encoding, hashValue, hashAlgorithmName,
                       clientData, plugin, originalDecision));
        }