INSERT INTO blc_security_scope ("id", "name", "open")VALUES ('-1100', 'SHARED_CODE_AUDIT_SUMMARY', 'N');
INSERT INTO blc_permission_scope (id, "permission", is_permission_root, scope_id)
VALUES('-1500', 'SHARED_CODE_AUDIT_SUMMARY', 'Y', '-1100');
INSERT INTO blc_user_permission ("id", "archived", "last_updated", "name", "is_account_perm")
VALUES('-105', 'N', '1970-01-01 00:00:00.000', 'ALL_INVENTORY_SUMMARY', 'N');
INSERT INTO blc_user_permission ("id", "archived", "last_updated", "name", "is_account_perm")
VALUES('-106', 'N', '1970-01-01 00:00:00.000', 'READ_INVENTORY_SUMMARY', 'N');
INSERT INTO blc_user_permission ("id", "archived", "last_updated", "name", "is_account_perm")
VALUES('-830', 'N', '1970-01-01 00:00:00.000', 'ALL_SHARED_CODE_AUDIT_SUMMARY', 'N');
INSERT INTO blc_user_permission ("id", "archived", "last_updated", "name", "is_account_perm")
VALUES('-831', 'N', '1970-01-01 00:00:00.000', 'READ_SHARED_CODE_AUDIT_SUMMARY', 'N');
-- Admin Roles
--- READ_SHARED_CODE_AUDIT_SUMMARY to PARTIAL_ACCESS role
INSERT INTO blc_role_permission_xref (role_id, permission_id) VALUES ('-1', '-831');
--- ALL_SHARED_CODE_AUDIT_SUMMARY to FULL_ACCESS, APPLICATION_ACCESS, and MARKETPLACE_OPERATOR roles
INSERT INTO blc_role_permission_xref (role_id, permission_id) VALUES ('-2', '-830');
INSERT INTO blc_role_permission_xref (role_id, permission_id) VALUES ('-7', '-830');
INSERT INTO blc_role_permission_xref (role_id, permission_id) VALUES ('-200', '-830');
--- ALL_INVENTORY_SUMMARY to FULL_ACCESS, VENDOR_ADMIN, and VENDOR_MERCHANDISER roles
INSERT INTO blc_role_permission_xref (role_id, permission_id) VALUES ('-2', '-105');
INSERT INTO blc_role_permission_xref (role_id, permission_id) VALUES ('-201', '-105');
INSERT INTO blc_role_permission_xref (role_id, permission_id) VALUES ('-202', '-105');
--- READ_SHARED_CODE_AUDIT_SUMMARY to APPLICATION_ACCESS, MARKETPLACE_OPERATOR, and ROLE_CUSTOMER_USER roles
INSERT INTO blc_role_permission_xref (role_id, permission_id) VALUES ('-7', '-106');
INSERT INTO blc_role_permission_xref (role_id, permission_id) VALUES ('-200', '-106');
INSERT INTO blc_role_permission_xref (role_id, permission_id) VALUES ('-100', '-106');
--- Remove READ_ACCOUNT_ORDER from ACCOUNT_MEMBER role
DELETE FROM blc_role_permission_xref WHERE role_id = '-1000' AND permission_id = '-501';
-- Anonymous Client
INSERT INTO blc_client_scopes ("id", "scope") VALUES ('anonymous', 'INVENTORY_SUMMARY');
INSERT INTO blc_client_permissions ("id", "permission") VALUES ('anonymous', 'READ_INVENTORY_SUMMARY');