public static void DirectoryServicesPermissionAttributeCallMethods()
 {
     var dpa = new DirectoryServicesPermissionAttribute(new SecurityAction());
     DirectoryServicesPermissionAccess pa = dpa.PermissionAccess;
     string      path = dpa.Path;
     IPermission ip   = dpa.CreatePermission();
 }
 /// <include file='doc\DirectoryServicesPermissionEntry.uex' path='docs/doc[@for="DirectoryServicesPermissionEntry.DirectoryServicesPermissionEntry"]/*' />
 public DirectoryServicesPermissionEntry(DirectoryServicesPermissionAccess permissionAccess, string path) {
     if (path == null)
         throw new ArgumentNullException("path");
             
     this.permissionAccess = permissionAccess;
     this.path = path;
 }  
 public DirectoryServicesPermissionEntry(DirectoryServicesPermissionAccess permissionAccess, string path)
 {
     if (path == null)
     {
         throw new ArgumentNullException("path");
     }
     this.permissionAccess = permissionAccess;
     this.path             = path;
 }
Exemple #4
0
        public void DirectoryServicesPermissionAccesss_Bad()
        {
            DirectoryServicesPermissionAccess dspa = (DirectoryServicesPermissionAccess)Int32.MinValue;
            DirectoryServicesPermission       dsp  = new DirectoryServicesPermission(dspa, String.Empty);

            Assert.AreEqual(1, dsp.PermissionEntries.Count, "Count");
            Assert.AreEqual((DirectoryServicesPermissionAccess)Int32.MinValue, dsp.PermissionEntries [0].PermissionAccess, "PermissionAccess");
            Assert.AreEqual(String.Empty, dsp.PermissionEntries [0].Path, "Path");
        }
Exemple #5
0
        public override IPermission CreatePermission()
        {
            if (base.Unrestricted)
            {
                return(new DirectoryServicesPermission(PermissionState.Unrestricted));
            }
            DirectoryServicesPermissionAccess permissionAccess = this.permissionAccess;

            return(new DirectoryServicesPermission(permissionAccess, this.Path));
        }
        /// <include file='doc\DirectoryServicesPermissionAttribute.uex' path='docs/doc[@for="DirectoryServicesPermissionAttribute.CreatePermission"]/*' />
        public override IPermission CreatePermission()
        {
            if (Unrestricted)
            {
                return(new DirectoryServicesPermission(PermissionState.Unrestricted));
            }

            DirectoryServicesPermissionAccess tmpAccess = this.permissionAccess;
            string tmpPath = this.Path;

            return(new DirectoryServicesPermission(tmpAccess, tmpPath));
        }
Exemple #7
0
 internal DirectoryServicesPermissionEntryCollection(DirectoryServicesPermission owner)
 {
     this.owner = owner;
     ResourcePermissionBaseEntry[] entries = owner.GetEntries();
     if (entries.Length > 0)
     {
         foreach (ResourcePermissionBaseEntry entry in entries)
         {
             DirectoryServicesPermissionAccess dspa = (DirectoryServicesPermissionAccess)entry.PermissionAccess;
             DirectoryServicesPermissionEntry  dspe = new DirectoryServicesPermissionEntry(dspa, entry.PermissionAccessPath [0]);
             // we don't want to add them (again) to the base class
             InnerList.Add(dspe);
         }
     }
 }
Exemple #8
0
        public void PermissionEntries()
        {
            DirectoryServicesPermissionAccess          dspa  = DirectoryServicesPermissionAccess.None;
            DirectoryServicesPermission                dsp   = new DirectoryServicesPermission(dspa, String.Empty);
            DirectoryServicesPermissionEntryCollection dspec = dsp.PermissionEntries;

            Assert.AreEqual(1, dspec.Count, "Count==1");

            DirectoryServicesPermissionEntry dspe = new DirectoryServicesPermissionEntry(DirectoryServicesPermissionAccess.Browse, "*");

            dsp.PermissionEntries.Add(dspe);
            Assert.AreEqual(2, dspec.Count, "Count==2");

            // remove (same instance)
            dsp.PermissionEntries.Remove(dspe);
            Assert.AreEqual(1, dspec.Count, "Count==1 (b)");

            // remove different instance (doesn't work)
            dspe = new DirectoryServicesPermissionEntry(DirectoryServicesPermissionAccess.None, String.Empty);
            Assert.AreEqual(1, dspec.Count, "Count==1");
        }
 /// <include file='doc\DirectoryServicesPermission.uex' path='docs/doc[@for="DirectoryServicesPermission.DirectoryServicesPermission2"]/*' />
 /// <devdoc>
 ///    <para>[To be supplied.]</para>
 /// </devdoc>
 public DirectoryServicesPermission(DirectoryServicesPermissionAccess permissionAccess, string path) {            
     SetNames();
     this.AddPermissionAccess(new DirectoryServicesPermissionEntry(permissionAccess, path));              
 }         
 public DirectoryServicesPermission(DirectoryServicesPermissionAccess permissionAccess, string path)
 {
 }
 public DirectoryServicesPermissionEntry(DirectoryServicesPermissionAccess permissionAccess, string path)
 {
 }
 public DirectoryServicesPermissionAttribute(SecurityAction action)
     : base(action)
 {
     path   = ResourcePermissionBase.Any;
     access = DirectoryServicesPermissionAccess.Browse;
 }
		public DirectoryServicesPermission (DirectoryServicesPermissionAccess access, string path)
		{
			SetUp ();
			innerCollection = new DirectoryServicesPermissionEntryCollection (this);
			innerCollection.Add (new DirectoryServicesPermissionEntry (access, path));
		}
Exemple #14
0
 public DirectoryServicesPermission(DirectoryServicesPermissionAccess access, string path)
 {
     SetUp();
     innerCollection = new DirectoryServicesPermissionEntryCollection(this);
     innerCollection.Add(new DirectoryServicesPermissionEntry(access, path));
 }
Exemple #15
0
 public DirectoryServicesPermissionEntry(DirectoryServicesPermissionAccess permissionAccess, string path)
 {
     this.permissionAccess = permissionAccess;
     this.path             = path;
 }
 public DirectoryServicesPermissionEntry(DirectoryServicesPermissionAccess permissionAccess, string?path)
 {
 }
Exemple #17
0
 /// <include file='doc\DirectoryServicesPermissionEntry.uex' path='docs/doc[@for="DirectoryServicesPermissionEntry.DirectoryServicesPermissionEntry1"]/*' />
 ///<internalonly/>
 internal DirectoryServicesPermissionEntry(ResourcePermissionBaseEntry baseEntry)
 {
     this.permissionAccess = (DirectoryServicesPermissionAccess)baseEntry.PermissionAccess;
     this.path             = baseEntry.PermissionAccessPath[0];
 }
 internal DirectoryServicesPermissionEntry(ResourcePermissionBaseEntry baseEntry)
 {
     this.permissionAccess = (DirectoryServicesPermissionAccess) baseEntry.PermissionAccess;
     this.path = baseEntry.PermissionAccessPath[0];
 }
		public DirectoryServicesPermissionEntry (DirectoryServicesPermissionAccess permissionAccess, string path)
		{
			this.permissionAccess = permissionAccess;
			this.path = path;
		}
Exemple #20
0
 public DirectoryServicesPermission(DirectoryServicesPermissionAccess permissionAccess, string path)
 {
     this.SetNames();
     this.AddPermissionAccess(new DirectoryServicesPermissionEntry(permissionAccess, path));
 }
		public DirectoryServicesPermissionAttribute (SecurityAction action)
			: base (action)
		{
			path = ResourcePermissionBase.Any;
			access = DirectoryServicesPermissionAccess.Browse;
		}
Exemple #22
0
 /// <include file='doc\DirectoryServicesPermissionAttribute.uex' path='docs/doc[@for="DirectoryServicesPermissionAttribute.DirectoryServicesPermissionAttribute"]/*' />
 public DirectoryServicesPermissionAttribute(SecurityAction action)
     : base(action)
 {
     this.path             = "*";
     this.permissionAccess = DirectoryServicesPermissionAccess.Browse;
 }
 /// <include file='doc\DirectoryServicesPermissionAttribute.uex' path='docs/doc[@for="DirectoryServicesPermissionAttribute.DirectoryServicesPermissionAttribute"]/*' />
 public DirectoryServicesPermissionAttribute(SecurityAction action)
 : base(action) {
     this.path = "*";
     this.permissionAccess = DirectoryServicesPermissionAccess.Browse;            
 }