Beispiel #1
0
        /// <summary>
        /// Turns the on is inherited.
        /// </summary>
        public void TurnOnIsInherited()
        {
            using (IDataReader fileReader = DBDirectory.GetById(CurrentTimeZoneId, 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,
                                                                       (Guid)SqlHelper.DBNull2Null(aclReader["ownerKey"], Guid.Empty)));
                        }
                    }
                }
            }

            _isInherited = true;
            SetChanged();
        }