示例#1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ReportAccessControList"/> class.
        /// </summary>
        /// <param name="reader">The reader.</param>
        internal ReportAccessControList(IDataReader reader)
        {
            bool bFirstRun = true;

            while (reader.Read())
            {
                if (bFirstRun)
                {
                    _id            = (int)reader["AclId"];
                    _ownerReportId = (int)reader["ReportId"];
                    bFirstRun      = false;
                }

                if (reader["AceId"] != DBNull.Value)
                {
                    this.Add(ReportAccessControlEntry.InternalCreate((int)reader["AceId"],
                                                                     (string)SqlHelper.DBNull2Null(reader["role"]),
                                                                     (int)SqlHelper.DBNull2Null(reader["principalId"], 0),
                                                                     (string)SqlHelper.DBNull2Null(reader["action"]),
                                                                     (bool)SqlHelper.DBNull2Null(reader["allow"]),
                                                                     false));
                }
            }

            Reset();
        }