Exemplo n.º 1
0
        /// <summary>
        /// Creates a new instance of the evaluaion context.
        /// </summary>
        /// <param name="engine">The engine instance.</param>
        /// <param name="policyDocument">The policy document instance.</param>
        /// <param name="contextDocument">The context document instance.</param>
        public EvaluationContext(EvaluationEngine engine, PolicyDocument policyDocument, ContextDocument contextDocument)
            : this()
        {
            var attributes = new AttributeReadWriteCollection();
            foreach (AttributeElementReadWrite attribute in contextDocument.Request.Resources[0].Attributes)
            {
                attributes.Add(new AttributeElementReadWrite(attribute));
            }

            ResourceContentElement resourceContent = null;
            if (contextDocument.Request.Resources[0].ResourceContent != null)
            {
                resourceContent = new ResourceContentElement(
                        contextDocument.Request.Resources[0].ResourceContent.XmlDocument,
                        contextDocument.Request.Resources[0].ResourceContent.SchemaVersion);
            }

            _engine = engine;
            _policyDocument = policyDocument;
            _contextDocument = contextDocument;
            CurrentResource = new ResourceElementReadWrite(
                resourceContent,
                contextDocument.Request.Resources[0].ResourceScopeValue,
                attributes,
                contextDocument.Request.Resources[0].SchemaVersion);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Adds an object to the end of the CollectionBase.
 /// </summary>
 /// <param name="value">The Object to be added to the end of the CollectionBase. </param>
 /// <returns>The CollectionBase index at which the value has been added.</returns>
 public override sealed int Add(ResourceElementReadWrite value)
 {
     if (value == null) throw new ArgumentNullException("value");
     ResourceContentElement resourceContent = null;
     if (value.ResourceContent != null)
     {
         resourceContent = new ResourceContentElement(value.ResourceContent.XmlDocument, value.ResourceContent.SchemaVersion);
     }
     return (List.Add(new ResourceElement(resourceContent, value.ResourceScopeValue, new AttributeCollection(value.Attributes), value.SchemaVersion)));
 }
Exemplo n.º 3
0
        /// <summary>
        /// Adds an object to the end of the CollectionBase.
        /// </summary>
        /// <param name="value">The Object to be added to the end of the CollectionBase. </param>
        /// <returns>The CollectionBase index at which the value has been added.</returns>
        public override sealed int Add(ResourceElementReadWrite value)
        {
            if (value == null)
            {
                throw new ArgumentNullException("value");
            }
            ResourceContentElement resourceContent = null;

            if (value.ResourceContent != null)
            {
                resourceContent = new ResourceContentElement(value.ResourceContent.XmlDocument, value.ResourceContent.SchemaVersion);
            }
            return(List.Add(new ResourceElement(resourceContent, value.ResourceScopeValue, new AttributeCollection(value.Attributes), value.SchemaVersion)));
        }
Exemplo n.º 4
0
 /// <summary>
 /// Creates a Resource using the specified arguments.
 /// </summary>
 /// <param name="resourceScope">The resource scope for this target item.</param>
 /// <param name="resourceContent">The resource content in the context document.</param>
 /// <param name="attributes">The attribute list.</param>
 /// <param name="schemaVersion">The version of the schema that was used to validate.</param>
 public ResourceElement(ResourceContentElement resourceContent, ResourceScope resourceScope, AttributeCollection attributes, XacmlVersion schemaVersion)
     : base(resourceContent, resourceScope, attributes, schemaVersion)
 {
 }
Exemplo n.º 5
0
		/// <summary>
		/// Creates a Resource using the specified arguments.
		/// </summary>
		/// <param name="resourceScope">The resource scope for this target item.</param>
		/// <param name="resourceContent">The resource content in the context document.</param>
		/// <param name="attributes">The attribute list.</param>
		/// <param name="schemaVersion">The version of the schema that was used to validate.</param>
		public ResourceElement( ResourceContentElement resourceContent, ResourceScope resourceScope, AttributeCollection attributes, XacmlVersion schemaVersion ) 
			: base( resourceContent, resourceScope, attributes, schemaVersion )
		{
		}