INSERT INTO blc_security_scope (id, "name", "open") VALUES('-74', 'CAMPAIGN_CODE', 'N');
INSERT INTO blc_security_scope (id, "name", "open") VALUES('-75', 'SHIPPING_LABEL', 'N');
INSERT INTO blc_security_scope (id, "name", "open") VALUES('-76', 'SHIPPING_RATES', 'N');
INSERT INTO blc_security_scope (id, "name", "open") VALUES('-77', 'CUSTOMER_PAYMENT_MANAGEMENT', 'N');
INSERT INTO blc_security_scope (id, "name", "open") VALUES('-78', 'SYSTEM_PAYMENT_MANAGEMENT', 'N');
INSERT INTO blc_security_scope (id, "name", "open") VALUES('-79', 'EXECUTE_AUTHORIZE', 'N');
INSERT INTO blc_security_scope (id, "name", "open") VALUES('-80', 'EXECUTE_AUTHORIZE_AND_CAPTURE', 'N');
INSERT INTO blc_security_scope (id, "name", "open") VALUES('-81', 'EXECUTE_REVERSE_AUTHORIZE', 'N');
INSERT INTO blc_security_scope (id, "name", "open") VALUES('-82', 'EXECUTE_CAPTURE', 'N');
INSERT INTO blc_security_scope (id, "name", "open") VALUES('-83', 'EXECUTE_REFUND', 'N');
INSERT INTO blc_security_scope (id, "name", "open") VALUES('-84', 'SENSITIVE_CUSTOMER_PAYMENT_ACCOUNT', 'N');
INSERT INTO blc_security_scope (id, "name", "open") VALUES('-85', 'SENSITIVE_PAYMENT', 'N');
INSERT INTO blc_permission_scope (id, permission, is_permission_root, scope_id) VALUES ('-115', 'CAMPAIGN_CODE', 'Y', '-74');
INSERT INTO blc_permission_scope (id, "permission", is_permission_root, scope_id) VALUES('-120', 'SHIPPING_LABEL', 'Y', '-75');
INSERT INTO blc_permission_scope (id, "permission", is_permission_root, scope_id) VALUES('-121', 'SHIPPING_RATES', 'Y', '-76');
INSERT INTO blc_permission_scope (id, "permission", is_permission_root, scope_id) VALUES('-122', 'CUSTOMER_PAYMENT_MANAGEMENT', 'Y', '-100');
INSERT INTO blc_permission_scope (id, "permission", is_permission_root, scope_id) VALUES('-123', 'SYSTEM_PAYMENT_MANAGEMENT', 'Y', '-78');
INSERT INTO blc_permission_scope (id, "permission", is_permission_root, scope_id) VALUES('-124', 'EXECUTE_AUTHORIZE', 'Y', '-79');
INSERT INTO blc_permission_scope (id, "permission", is_permission_root, scope_id) VALUES('-125', 'EXECUTE_AUTHORIZE_AND_CAPTURE', 'Y', '-80');
INSERT INTO blc_permission_scope (id, "permission", is_permission_root, scope_id) VALUES('-126', 'EXECUTE_REVERSE_AUTHORIZE', 'Y', '-81');
INSERT INTO blc_permission_scope (id, "permission", is_permission_root, scope_id) VALUES('-127', 'EXECUTE_CAPTURE', 'Y', '-82');
INSERT INTO blc_permission_scope (id, "permission", is_permission_root, scope_id) VALUES('-128', 'EXECUTE_REFUND', 'Y', '-83');
INSERT INTO blc_permission_scope (id, "permission", is_permission_root, scope_id) VALUES('-129', 'CUSTOMER_PAYMENT_MANAGEMENT', 'Y', '-77');
INSERT INTO blc_permission_scope (id, "permission", is_permission_root, scope_id) VALUES('-130', 'SENSITIVE_CUSTOMER_PAYMENT_ACCOUNT', 'Y', '-84');
INSERT INTO blc_permission_scope (id, "permission", is_permission_root, scope_id) VALUES('-131', 'SENSITIVE_PAYMENT', 'Y', '-85');
INSERT INTO blc_user_permission (id, archived, last_updated, "name") VALUES('-231', 'N', '1970-01-01 00:00:00.000', 'ALL_SHIPPING_LABEL');
INSERT INTO blc_user_permission (id, archived, last_updated, "name") VALUES('-232', 'N', '1970-01-01 00:00:00.000', 'READ_SHIPPING_LABEL');
INSERT INTO blc_user_permission (id, archived, last_updated, "name") VALUES('-233', 'N', '1970-01-01 00:00:00.000', 'ALL_SHIPPING_RATES');
INSERT INTO blc_user_permission (id, archived, last_updated, "name") VALUES('-234', 'N', '1970-01-01 00:00:00.000', 'READ_SHIPPING_RATES');
INSERT INTO blc_user_permission (id, archived, last_updated, "name") VALUES('-235', 'N', '1970-01-01 00:00:00.000', 'ALL_CUSTOMER_PAYMENT_MANAGEMENT');
INSERT INTO blc_user_permission (id, archived, last_updated, "name") VALUES('-236', 'N', '1970-01-01 00:00:00.000', 'READ_CUSTOMER_PAYMENT_MANAGEMENT');
INSERT INTO blc_user_permission (id, archived, last_updated, "name") VALUES('-237', 'N', '1970-01-01 00:00:00.000', 'ALL_SYSTEM_PAYMENT_MANAGEMENT');
INSERT INTO blc_user_permission (id, archived, last_updated, "name") VALUES('-238', 'N', '1970-01-01 00:00:00.000', 'READ_SYSTEM_PAYMENT_MANAGEMENT');
INSERT INTO blc_user_permission (id, archived, last_updated, "name") VALUES('-239', 'N', '1970-01-01 00:00:00.000', 'ALL_EXECUTE_AUTHORIZE');
INSERT INTO blc_user_permission (id, archived, last_updated, "name") VALUES('-240', 'N', '1970-01-01 00:00:00.000', 'ALL_EXECUTE_AUTHORIZE_AND_CAPTURE');
INSERT INTO blc_user_permission (id, archived, last_updated, "name") VALUES('-241', 'N', '1970-01-01 00:00:00.000', 'ALL_EXECUTE_REVERSE_AUTHORIZE');
INSERT INTO blc_user_permission (id, archived, last_updated, "name") VALUES('-242', 'N', '1970-01-01 00:00:00.000', 'ALL_EXECUTE_CAPTURE');
INSERT INTO blc_user_permission (id, archived, last_updated, "name") VALUES('-243', 'N', '1970-01-01 00:00:00.000', 'ALL_EXECUTE_REFUND');
INSERT INTO blc_user_permission (id, archived, last_updated, "name") VALUES('-244', 'N', '1970-01-01 00:00:00.000', 'ALL_RECORD_TRANSACTION_RESULTS');
INSERT INTO blc_client_scopes (id, "scope") VALUES('cartopsclient', 'EXECUTE_AUTHORIZE');
INSERT INTO blc_client_scopes (id, "scope") VALUES('cartopsclient', 'SHIPPING_RATES');
INSERT INTO blc_client_scopes (id, "scope") VALUES('cartopsclient', 'SYSTEM_PAYMENT_MANAGEMENT');
INSERT INTO blc_client_scopes (id, "scope") VALUES('cartopsclient', 'EXECUTE_AUTHORIZE_AND_CAPTURE');
INSERT INTO blc_client_scopes (id, "scope") VALUES('cartopsclient', 'INVENTORY_RESERVATION');
INSERT INTO blc_client_scopes (id, "scope") VALUES('orderopsclient', 'EXECUTE_REFUND');
INSERT INTO blc_client_scopes (id, "scope") VALUES('orderopsclient', 'CAMPAIGN_CODE');
INSERT INTO blc_client_scopes (id, "scope") VALUES('orderopsclient', 'EXECUTE_AUTHORIZE');
INSERT INTO blc_client_scopes (id, "scope") VALUES('orderopsclient', 'SYSTEM_PAYMENT_MANAGEMENT');
INSERT INTO blc_client_scopes (id, "scope") VALUES('orderopsclient', 'EXECUTE_CAPTURE');
INSERT INTO blc_client_scopes (id, "scope") VALUES('orderopsclient', 'EXECUTE_REVERSE_AUTHORIZE');
INSERT INTO blc_client_scopes (id, "scope") VALUES('orderopsclient', 'EXECUTE_AUTHORIZE_AND_CAPTURE');
INSERT INTO blc_client_scopes (id, "scope") VALUES('paymenttransactionclient', 'SENSITIVE_CUSTOMER_PAYMENT_ACCOUNT');
INSERT INTO blc_client_scopes (id, "scope") VALUES('customerclient', 'SENSITIVE_PAYMENT');
INSERT INTO blc_client_scopes (id, "scope") VALUES('anonymous', 'CUSTOMER_PAYMENT_MANAGEMENT');
INSERT INTO blc_client_permissions (id, "permission") VALUES('cartopsclient', 'ALL_EXECUTE_AUTHORIZE_AND_CAPTURE');
INSERT INTO blc_client_permissions (id, "permission") VALUES('cartopsclient', 'READ_SHIPPING_RATES');
INSERT INTO blc_client_permissions (id, "permission") VALUES('cartopsclient', 'ALL_SYSTEM_PAYMENT_MANAGEMENT');
INSERT INTO blc_client_permissions (id, "permission") VALUES('cartopsclient', 'ALL_INVENTORY_RESERVATION');
INSERT INTO blc_client_permissions (id, "permission") VALUES('cartopsclient', 'ALL_EXECUTE_AUTHORIZE');
INSERT INTO blc_client_permissions (id, "permission") VALUES('orderopsclient', 'ALL_CAMPAIGN_CODE');
INSERT INTO blc_client_permissions (id, "permission") VALUES('orderopsclient', 'ALL_EXECUTE_AUTHORIZE');
INSERT INTO blc_client_permissions (id, "permission") VALUES('orderopsclient', 'ALL_EXECUTE_REVERSE_AUTHORIZE');
INSERT INTO blc_client_permissions (id, "permission") VALUES('orderopsclient', 'ALL_EXECUTE_REFUND');
INSERT INTO blc_client_permissions (id, "permission") VALUES('orderopsclient', 'ALL_EXECUTE_CAPTURE');
INSERT INTO blc_client_permissions (id, "permission") VALUES('orderopsclient', 'ALL_EXECUTE_AUTHORIZE_AND_CAPTURE');
INSERT INTO blc_client_permissions (id, "permission") VALUES('orderopsclient', 'ALL_SYSTEM_PAYMENT_MANAGEMENT');
INSERT INTO blc_client_permissions (id, "permission") VALUES('paymenttransactionclient', 'READ_SENSITIVE_CUSTOMER_PAYMENT_ACCOUNT');
INSERT INTO blc_client_permissions (id, "permission") VALUES('customerclient', 'READ_SENSITIVE_PAYMENT');
INSERT INTO blc_client_permissions (id, "permission") VALUES('anonymous', 'ALL_CUSTOMER_PAYMENT_MANAGEMENT');
-- PRICE_LIST permission scope for customer security scope
DELETE FROM blc_permission_scope WHERE id = '-102';
-- CAMPAIGN permission scope for customer security scope
DELETE FROM blc_permission_scope WHERE id = '-103';
-- OFFER permission scope for customer security scope
DELETE FROM blc_permission_scope WHERE id = '-105';
-- DEFAULT ROLE UPDATES
-- REQUIRED. Customer user role changes
-- READ_SHIPPING_RATES permission
INSERT INTO auth.blc_role_permission_xref (role_id, permission_id) VALUES ('-100', '-234');
-- ALL_CUSTOMER_PAYMENT_MANAGEMENT permission
INSERT INTO auth.blc_role_permission_xref (role_id, permission_id) VALUES ('-100', '-235');
-- These role updates may or may not be necessary depending on if you are using out of box roles.
-- "PARTIAL" role adds read shipping label permission
INSERT INTO blc_role_permission_xref (role_id, permission_id) VALUES ('-1', '-232');
-- "FULL_ACCESS" role adds all shipping label permission
INSERT INTO blc_role_permission_xref (role_id, permission_id) VALUES ('-2', '-231');
-- "ROLE_MARKETPLACE_OPERATOR" role adds all shipping label permission
INSERT INTO blc_role_permission_xref (role_id, permission_id) VALUES ('-200', '-231');
-- "ROLE_VENDOR_ADMIN" role adds all shipping label permission
INSERT INTO blc_role_permission_xref (role_id, permission_id) VALUES ('-201', '-231');