/// <summary> /// Turns the on is inherited. /// </summary> public void TurnOnIsInherited() { using (IDataReader fileReader = DBDirectory.GetById(this.OwnerDirectoryId)) { if (fileReader.Read()) { int ParentDirectoryId = (int)fileReader["ParentDirectoryId"]; using (IDataReader aclReader = DBAccessControlList.GetAcl(ParentDirectoryId)) { while (aclReader.Read()) { this.Add(AccessControlEntry.InternalCreate((int)aclReader["AceId"], true, (string)SqlHelper.DBNull2Null(aclReader["role"]), (int)SqlHelper.DBNull2Null(aclReader["principalId"], 0), (string)SqlHelper.DBNull2Null(aclReader["action"]), (bool)(((byte)SqlHelper.DBNull2Null(aclReader["allow"])) == 1), false)); } } } } _isInherited = true; SetChanged(); }
internal static DirectoryInfo InnerGetDirectory(int DirectoryId) { using (IDataReader reader = DBDirectory.GetById(DirectoryId)) { if (reader.Read()) { return(new DirectoryInfo(null, reader)); } else { return(null); } } }
/// <summary> /// Gets the directory. /// </summary> /// <param name="DirectoryId">The directory id.</param> /// <returns></returns> public DirectoryInfo GetDirectory(int DirectoryId) { using (IDataReader reader = DBDirectory.GetById(DirectoryId)) { if (reader.Read()) { return(new DirectoryInfo(this, reader)); } else { return(null); } } }