/// <summary>
		/// Creates a new Request using the parameters specified.
		/// </summary>
		/// <param name="subjects">The subjects list.</param>
		/// <param name="resources">The resource requested</param>
		/// <param name="action">The action requested.</param>
		/// <param name="environment">Any environment attribute part of the request.</param>
		/// <param name="schemaVersion">The version of the schema that was used to validate.</param>
		public RequestElementReadWrite( SubjectReadWriteCollection subjects, ResourceReadWriteCollection resources, ActionElementReadWrite action, EnvironmentElementReadWrite environment, XacmlVersion schemaVersion )
			: base( XacmlSchema.Context, schemaVersion )
		{
			_subjects = subjects;
			_resources = resources;
			_action = action;
			_environment = environment;
		}
Example #2
0
 /// <summary>
 /// Creates a new Request using the parameters specified.
 /// </summary>
 /// <param name="subjects">The subjects list.</param>
 /// <param name="resources">The resource requested</param>
 /// <param name="action">The action requested.</param>
 /// <param name="environment">Any environment attribute part of the request.</param>
 /// <param name="schemaVersion">The version of the schema that was used to validate.</param>
 public RequestElementReadWrite(SubjectReadWriteCollection subjects, ResourceReadWriteCollection resources, ActionElementReadWrite action, EnvironmentElementReadWrite environment, XacmlVersion schemaVersion)
     : base(XacmlSchema.Context, schemaVersion)
 {
     _subjects    = subjects;
     _resources   = resources;
     _action      = action;
     _environment = environment;
 }
Example #3
0
		/// <summary>
		/// 
		/// </summary>
		/// <param name="action"></param>
		public Action( con.ActionElementReadWrite action )
		{
			_action = action;

			this.Text = "Action";
			this.SelectedImageIndex = 2;
			this.ImageIndex = 2;

			foreach( con.AttributeElementReadWrite attr in _action.Attributes )
			{
				this.Nodes.Add( new Attribute( attr ) );
			}
		}
Example #4
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="action"></param>
        public Action(con.ActionElementReadWrite action)
        {
            _action = action;

            this.Text = "Action";
            this.SelectedImageIndex = 2;
            this.ImageIndex         = 2;

            foreach (con.AttributeElementReadWrite attr in _action.Attributes)
            {
                this.Nodes.Add(new Attribute(attr));
            }
        }
Example #5
0
        /// <summary>
        /// Creates a new Request using the XmlReader instance provided.
        /// </summary>
        /// <param name="reader">The XmlReader positioned at the Request node.</param>
        /// <param name="schemaVersion">The version of the schema that was used to validate.</param>
        public RequestElementReadWrite(XmlReader reader, XacmlVersion schemaVersion)
            : base(XacmlSchema.Context, schemaVersion)
        {
            if (reader == null)
            {
                throw new ArgumentNullException("reader");
            }
            if (reader.LocalName == ContextSchema.RequestElement.Request)
            {
                while (reader.Read())
                {
                    switch (reader.LocalName)
                    {
                    case ContextSchema.RequestElement.Subject:
                        _subjects.Add(new SubjectElementReadWrite(reader, schemaVersion));
                        break;

                    case ContextSchema.RequestElement.Resource:
                        _resources.Add(new ResourceElementReadWrite(reader, schemaVersion));
                        break;

                    case ContextSchema.RequestElement.Action:
                        _action = new ActionElementReadWrite(reader, schemaVersion);
                        break;

                    case ContextSchema.RequestElement.Environment:
                        _environment = new EnvironmentElementReadWrite(reader, schemaVersion);
                        break;
                    }
                }
            }
            else
            {
                throw new Exception(Resource.ResourceManager[Resource.MessageKey.exc_invalid_node_name, reader.LocalName]);
            }
        }
Example #6
0
		private void CreateContextActionElement( object sender, EventArgs args)
		{
			con.ActionElementReadWrite newAction = new con.ActionElementReadWrite(new con.AttributeReadWriteCollection(), XacmlVersion.Version11);
			Request requestNode = (Request)mainTree.SelectedNode;
            var newNode = new ContextTreeNodes.Action(newAction);
			con.RequestElementReadWrite request = requestNode.RequestDefinition;

			request.Action = newAction;
			requestNode.Nodes.Add( newNode );
		}
		/// <summary>
		/// Creates a new Request using the XmlReader instance provided.
		/// </summary>
		/// <param name="reader">The XmlReader positioned at the Request node.</param>
		/// <param name="schemaVersion">The version of the schema that was used to validate.</param>
		public RequestElementReadWrite( XmlReader reader, XacmlVersion schemaVersion )
			: base( XacmlSchema.Context, schemaVersion )
		{
            if (reader == null) throw new ArgumentNullException("reader");
			if( reader.LocalName == ContextSchema.RequestElement.Request )
			{
				while( reader.Read() )
				{
					switch( reader.LocalName )
					{
						case ContextSchema.RequestElement.Subject:
							_subjects.Add( new SubjectElementReadWrite( reader, schemaVersion ) );
							break;
						case ContextSchema.RequestElement.Resource: 
							_resources.Add( new ResourceElementReadWrite( reader, schemaVersion ) );
							break;
						case ContextSchema.RequestElement.Action: 
							_action = new ActionElementReadWrite( reader, schemaVersion );
							break;
						case ContextSchema.RequestElement.Environment: 
							_environment = new EnvironmentElementReadWrite( reader, schemaVersion );
							break;
					}
				}
			}
			else
			{
				throw new Exception( Resource.ResourceManager[ Resource.MessageKey.exc_invalid_node_name, reader.LocalName ] );
			}
		}