~bibledit/bibledit/ubuntu-cloud-beta

« back to all changes in this revision

Viewing changes to user/notifications.cpp

  • Committer: Teus Benschop
  • Date: 2022-10-14 16:03:26 UTC
  • Revision ID: teusjannette@gmail.com-20221014160326-42ybrpft4bblpruk
new upstream version

Show diffs side-by-side

added added

removed removed

Lines of Context:
47
47
  // Consultant has access.
48
48
  if (Filter_Roles::access_control (webserver_request, Filter_Roles::consultant ())) return true;
49
49
  // Whoever can view notes has access.
50
 
  if (access_logic_privilege_view_notes (webserver_request)) return true;
 
50
  if (access_logic::privilege_view_notes (webserver_request)) return true;
51
51
  // Whoever has access to a Bible has access to this page.
52
 
  auto [ read, write ] = AccessBible::Any (webserver_request);
 
52
  auto [ read, write ] = access_bible::any (webserver_request);
53
53
  if (read) return true;
54
54
  // No access.
55
55
  return false;
65
65
  string page;
66
66
  
67
67
  Assets_Header header = Assets_Header (translate("Notifications"), webserver_request);
68
 
  header.addBreadCrumb (menu_logic_settings_menu (), menu_logic_settings_text ());
 
68
  header.add_bread_crumb (menu_logic_settings_menu (), menu_logic_settings_text ());
69
69
  page = header.run ();
70
70
  
71
71
  Assets_View view;
199
199
  // The set of Bibles the user can choose
200
200
  // is limited to those Bibles the user has read access to.
201
201
  {
202
 
    vector <string> bibles = AccessBible::Bibles (webserver_request);
 
202
    vector <string> bibles = access_bible::bibles (webserver_request);
203
203
    for (const auto & bible : bibles) {
204
204
      if (checkbox == "changenotificationbible" + bible) {
205
205
        vector <string> currentbibles = database_config_user.getChangeNotificationsBibles();
241
241
  view.set_variable ("url", client_logic_link_to_cloud (user_notifications_url (), translate("You can set the notifications in Bibledit Cloud.")));
242
242
 
243
243
  // The bits accessible to the user depends on the user's privileges.
244
 
  auto [ read_bible, write_bible ] = AccessBible::Any (webserver_request);
 
244
  auto [ read_bible, write_bible ] = access_bible::any (webserver_request);
245
245
  if (read_bible) view.enable_zone ("readbible");
246
246
  if (write_bible) view.enable_zone ("writebible");
247
247
  if (Filter_Roles::access_control (webserver_request, Filter_Roles::consultant ()))
251
251
  
252
252
  page += view.render ("user", "notifications");
253
253
 
254
 
  page += Assets_Page::footer ();
 
254
  page += assets_page::footer ();
255
255
 
256
256
  return page;
257
257
}