Fix #370870: do not delete node-specific settings when users without permission to...
authorJoao Ventura
Mon, 9 Feb 2009 20:20:10 +0000 (20:20 +0000)
committerJoao Ventura
Mon, 9 Feb 2009 20:20:10 +0000 (20:20 +0000)
print.module
print_mail/print_mail.module
print_pdf/print_pdf.module

index 5130420..745b96d 100644 (file)
@@ -305,7 +305,9 @@ function print_nodeapi(&$node, $op = 'view', $teaser, $page) {
       _print_set_node_fields($node);
       break;
     case 'update':
+      if (user_access('administer print') || user_access('node-specific print configuration')) {
       _print_node_conf_modify($node->nid, $node->print_display, $node->print_display_comment, $node->print_display_urllist);
+      }
       break;
     case 'delete':
       db_query("DELETE FROM {print_node_conf} WHERE nid = %d", $node->nid);
index 438455e..f2b0ecb 100644 (file)
@@ -218,7 +218,9 @@ function print_mail_nodeapi(&$node, $op = 'view', $teaser, $page) {
       _print_mail_set_node_fields($node);
       break;
     case 'update':
+      if (user_access('administer print') || user_access('node-specific print configuration')) {
       _print_mail_node_conf_modify($node->nid, $node->print_mail_display, $node->print_mail_display_comment, $node->print_mail_display_urllist);
+      }
       break;
     case 'delete':
       db_query("DELETE FROM {print_mail_node_conf} WHERE nid = %d", $node->nid);
index 71948ef..eca9505 100644 (file)
@@ -223,7 +223,9 @@ function print_pdf_nodeapi(&$node, $op = 'view', $teaser, $page) {
       _print_pdf_set_node_fields($node);
       break;
     case 'update':
+      if (user_access('administer print') || user_access('node-specific print configuration')) {
       _print_pdf_node_conf_modify($node->nid, $node->print_pdf_display, $node->print_pdf_display_comment, $node->print_pdf_display_urllist);
+      }
       break;
     case 'delete':
       db_query("DELETE FROM {print_pdf_node_conf} WHERE nid = %d", $node->nid);