Beispiel #1
0
 private void CreateFromParts(bool isContainer, bool isDS, System.Security.AccessControl.ControlFlags flags, SecurityIdentifier owner, SecurityIdentifier group, System.Security.AccessControl.SystemAcl systemAcl, System.Security.AccessControl.DiscretionaryAcl discretionaryAcl)
 {
     if ((systemAcl != null) && (systemAcl.IsContainer != isContainer))
     {
         throw new ArgumentException(Environment.GetResourceString(isContainer ? "AccessControl_MustSpecifyContainerAcl" : "AccessControl_MustSpecifyLeafObjectAcl"), "systemAcl");
     }
     if ((discretionaryAcl != null) && (discretionaryAcl.IsContainer != isContainer))
     {
         throw new ArgumentException(Environment.GetResourceString(isContainer ? "AccessControl_MustSpecifyContainerAcl" : "AccessControl_MustSpecifyLeafObjectAcl"), "discretionaryAcl");
     }
     this._isContainer = isContainer;
     if ((systemAcl != null) && (systemAcl.IsDS != isDS))
     {
         throw new ArgumentException(Environment.GetResourceString(isDS ? "AccessControl_MustSpecifyDirectoryObjectAcl" : "AccessControl_MustSpecifyNonDirectoryObjectAcl"), "systemAcl");
     }
     if ((discretionaryAcl != null) && (discretionaryAcl.IsDS != isDS))
     {
         throw new ArgumentException(Environment.GetResourceString(isDS ? "AccessControl_MustSpecifyDirectoryObjectAcl" : "AccessControl_MustSpecifyNonDirectoryObjectAcl"), "discretionaryAcl");
     }
     this._isDS = isDS;
     this._sacl = systemAcl;
     if (discretionaryAcl == null)
     {
         discretionaryAcl = System.Security.AccessControl.DiscretionaryAcl.CreateAllowEveryoneFullAccess(this._isDS, this._isContainer);
     }
     this._dacl = discretionaryAcl;
     System.Security.AccessControl.ControlFlags flags2 = flags | System.Security.AccessControl.ControlFlags.DiscretionaryAclPresent;
     if (systemAcl == null)
     {
         flags2 &= ~System.Security.AccessControl.ControlFlags.SystemAclPresent;
     }
     else
     {
         flags2 |= System.Security.AccessControl.ControlFlags.SystemAclPresent;
     }
     this._rawSd = new RawSecurityDescriptor(flags2, owner, group, (systemAcl == null) ? null : systemAcl.RawAcl, discretionaryAcl.RawAcl);
 }
 private void CreateFromParts(bool isContainer, bool isDS, System.Security.AccessControl.ControlFlags flags, SecurityIdentifier owner, SecurityIdentifier group, System.Security.AccessControl.SystemAcl systemAcl, System.Security.AccessControl.DiscretionaryAcl discretionaryAcl)
 {
     if ((systemAcl != null) && (systemAcl.IsContainer != isContainer))
     {
         throw new ArgumentException(Environment.GetResourceString(isContainer ? "AccessControl_MustSpecifyContainerAcl" : "AccessControl_MustSpecifyLeafObjectAcl"), "systemAcl");
     }
     if ((discretionaryAcl != null) && (discretionaryAcl.IsContainer != isContainer))
     {
         throw new ArgumentException(Environment.GetResourceString(isContainer ? "AccessControl_MustSpecifyContainerAcl" : "AccessControl_MustSpecifyLeafObjectAcl"), "discretionaryAcl");
     }
     this._isContainer = isContainer;
     if ((systemAcl != null) && (systemAcl.IsDS != isDS))
     {
         throw new ArgumentException(Environment.GetResourceString(isDS ? "AccessControl_MustSpecifyDirectoryObjectAcl" : "AccessControl_MustSpecifyNonDirectoryObjectAcl"), "systemAcl");
     }
     if ((discretionaryAcl != null) && (discretionaryAcl.IsDS != isDS))
     {
         throw new ArgumentException(Environment.GetResourceString(isDS ? "AccessControl_MustSpecifyDirectoryObjectAcl" : "AccessControl_MustSpecifyNonDirectoryObjectAcl"), "discretionaryAcl");
     }
     this._isDS = isDS;
     this._sacl = systemAcl;
     if (discretionaryAcl == null)
     {
         discretionaryAcl = System.Security.AccessControl.DiscretionaryAcl.CreateAllowEveryoneFullAccess(this._isDS, this._isContainer);
     }
     this._dacl = discretionaryAcl;
     System.Security.AccessControl.ControlFlags flags2 = flags | System.Security.AccessControl.ControlFlags.DiscretionaryAclPresent;
     if (systemAcl == null)
     {
         flags2 &= ~System.Security.AccessControl.ControlFlags.SystemAclPresent;
     }
     else
     {
         flags2 |= System.Security.AccessControl.ControlFlags.SystemAclPresent;
     }
     this._rawSd = new RawSecurityDescriptor(flags2, owner, group, (systemAcl == null) ? null : systemAcl.RawAcl, discretionaryAcl.RawAcl);
 }
Beispiel #3
0
 public CommonSecurityDescriptor(bool isContainer, bool isDS, System.Security.AccessControl.ControlFlags flags, SecurityIdentifier owner, SecurityIdentifier group, System.Security.AccessControl.SystemAcl systemAcl, System.Security.AccessControl.DiscretionaryAcl discretionaryAcl)
 {
     this.CreateFromParts(isContainer, isDS, flags, owner, group, systemAcl, discretionaryAcl);
 }