[glom] Added some TODOs about users without view rights.



commit cf8bfd05e2990e8ec6d088f47de8c4a99b358a0a
Author: Murray Cumming <murrayc murrayc com>
Date:   Thu Feb 23 13:27:37 2012 +0100

    Added some TODOs about users without view rights.

 glom/frame_glom.cc                                 |    2 ++
 .../datawidget/combochoiceswithtreemodel.cc        |    1 +
 glom/mode_data/db_adddel/db_adddel.cc              |    1 +
 3 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/glom/frame_glom.cc b/glom/frame_glom.cc
index 66d4c63..72f9398 100644
--- a/glom/frame_glom.cc
+++ b/glom/frame_glom.cc
@@ -394,6 +394,8 @@ void Frame_Glom::show_table_allow_empty(const Glib::ustring& table_name, const G
           type_vecLayoutFields layout_fields;
           layout_fields.push_back(layout_item_temp);
           Glib::RefPtr<Gnome::Gda::SqlBuilder> sql_query_without_sort = Utils::build_sql_select_with_where_clause(found_set.m_table_name, layout_fields, found_set.m_where_clause, found_set.m_extra_join, type_sort_clause());
+
+          //TODO: Avoid this if the user does not have view rights, because it would fail:
           const int count = DbUtils::count_rows_returned_by(sql_query_without_sort);
           if(count < 10000) //Arbitrary large number.
             found_set.m_sort_clause.push_back( type_pair_sort_field(layout_item_sort, true /* ascending */) );
diff --git a/glom/mode_data/datawidget/combochoiceswithtreemodel.cc b/glom/mode_data/datawidget/combochoiceswithtreemodel.cc
index 9339bcf..d8afc1a 100644
--- a/glom/mode_data/datawidget/combochoiceswithtreemodel.cc
+++ b/glom/mode_data/datawidget/combochoiceswithtreemodel.cc
@@ -314,6 +314,7 @@ void ComboChoicesWithTreeModel::set_choices_related(const Document* document, co
 
   //We create DbTreeModelWithExtraText rather than just DbTreeModel, 
   //because Combo(has_entry) needs it.
+  //TODO: Avoid getting the actual data if the user does not have view rights.
   m_refModel = DbTreeModelWithExtraText::create(found_set, layout_items, true /* allow_view */, false /* find mode */, m_db_layout_items);
   if(!m_refModel)
   {
diff --git a/glom/mode_data/db_adddel/db_adddel.cc b/glom/mode_data/db_adddel/db_adddel.cc
index f5f6b87..e0b0bed 100644
--- a/glom/mode_data/db_adddel/db_adddel.cc
+++ b/glom/mode_data/db_adddel/db_adddel.cc
@@ -671,6 +671,7 @@ void DbAddDel::construct_specified_columns()
     return;
   }
 
+  //TODO: Do not try to get the data if the user does not have view rights.
   m_refListStore = DbTreeModel::create(m_found_set, m_column_items, m_allow_view, m_find_mode, m_FieldsShown);
   //m_FieldsShown is needed by Base_DB_Table_Data::record_new().
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]