From 3eb7fda132f75eee7c3b79592717de6c76fdb53d Mon Sep 17 00:00:00 2001
From: Neil Drumm <drumm@delocalizedham.com>
Date: Tue, 19 Apr 2011 15:28:35 -0700
Subject: [PATCH 1/2] #954668 by ezra-g. Add node checkout process permission.

---
 uc_node_checkout.module |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/uc_node_checkout.module b/uc_node_checkout.module
index 09f5d3b..35fa983 100644
--- a/uc_node_checkout.module
+++ b/uc_node_checkout.module
@@ -89,7 +89,7 @@ function uc_node_checkout_admin_settings_title($type) {
  * Implementation of hook_perm().
  */
 function uc_node_checkout_perm() {
-  return array('administer node checkout');
+  return array('administer node checkout', 'bypass node checkout process');
 }
 
 /**
@@ -292,7 +292,7 @@ function uc_node_checkout_form_alter(&$form, &$form_state, $form_id) {
 
   // Alter the node forms for UC Node Checkout governed node types.
   foreach (uc_node_checkout_product_map() as $type => $value) {
-    if ($form_id == $type .'_node_form') {
+    if ($form_id == $type .'_node_form' && !user_access('bypass node checkout process')) {
       // Determine the product nid that will be added to the cart when this
       // node is created.  First look for a single product node association.
       if ($value['nid'] && !$value['view']) {
-- 
1.7.1


From 6f58bf58c1f4ccbbe7d61c10e65de2cea1932c6d Mon Sep 17 00:00:00 2001
From: Neil Drumm <drumm@delocalizedham.com>
Date: Tue, 19 Apr 2011 15:29:14 -0700
Subject: [PATCH 2/2] #954668 Allow admins to use node checkout process if they start with it.

---
 uc_node_checkout.module |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/uc_node_checkout.module b/uc_node_checkout.module
index 35fa983..5974b75 100644
--- a/uc_node_checkout.module
+++ b/uc_node_checkout.module
@@ -292,7 +292,7 @@ function uc_node_checkout_form_alter(&$form, &$form_state, $form_id) {
 
   // Alter the node forms for UC Node Checkout governed node types.
   foreach (uc_node_checkout_product_map() as $type => $value) {
-    if ($form_id == $type .'_node_form' && !user_access('bypass node checkout process')) {
+    if ($form_id == $type .'_node_form' && (!user_access('bypass node checkout process') || $_GET['product_nid'])) {
       // Determine the product nid that will be added to the cart when this
       // node is created.  First look for a single product node association.
       if ($value['nid'] && !$value['view']) {
-- 
1.7.1

