-- New scopes, permissions, and role assignments
INSERT INTO blc_security_scope (id, name, open) VALUES ('-1700', 'DATA_FEED_PROCESS', 'N');
INSERT INTO blc_permission_scope (id, permission, is_permission_root, scope_id) VALUES ('-1700', 'DATA_FEED_PROCESS', 'Y', '-1700');
INSERT INTO blc_user_permission (id, archived, last_updated, name, is_account_perm, user_assignable) VALUES ('-1000', 'N', '1970-01-01 00:00:00.000000', 'ALL_DATA_FEED_PROCESS', 'N', 'Y');
INSERT INTO blc_user_permission (id, archived, last_updated, name, is_account_perm, user_assignable) VALUES ('-1010', 'N', '1970-01-01 00:00:00.000000', 'READ_DATA_FEED_PROCESS', 'N', 'Y');
INSERT INTO blc_role_permission_xref (role_id, permission_id) VALUES ('-1', '-1010');
INSERT INTO blc_role_permission_xref (role_id, permission_id) VALUES ('-2', '-1000');
-- Add client for communication between DataFeedServices and other services
INSERT INTO blc_client (id, application_id, attributes, client_id, client_secret, friendly_name, is_admin, auth_server_id, token_timeout_seconds, default_redirect_uri, refresh_token_rot_intrvl_scnds, refresh_token_timeout_seconds, reset_password_base_uri) VALUES ('datafeedclient', null, '{}', 'datafeedclient', 'TODO MY SECRET', 'Data Feed Service Client', 'N', '2', 300, null, 60, 7200, null);
INSERT INTO blc_client_grant_types (id, grant_type) VALUES ('datafeedclient', 'client_credentials');
INSERT INTO blc_client_permissions (id, permission) VALUES ('datafeedclient', 'READ_RATING_DETAIL');
INSERT INTO blc_client_permissions (id, permission) VALUES ('datafeedclient', 'READ_PRODUCT_IGNORE_NARROWING');
INSERT INTO blc_client_permissions (id, permission) VALUES ('datafeedclient', 'READ_PRICE_LIST');
INSERT INTO blc_client_permissions (id, permission) VALUES ('datafeedclient', 'READ_CONSOLIDATED_INVENTORY_AVAILABILITY');
INSERT INTO blc_client_permissions (id, permission) VALUES ('datafeedclient', 'READ_INVENTORY');
INSERT INTO blc_client_scopes (id, scope) VALUES ('datafeedclient', 'INVENTORY');
INSERT INTO blc_client_scopes (id, scope) VALUES ('datafeedclient', 'PRICE_LIST');
INSERT INTO blc_client_scopes (id, scope) VALUES ('datafeedclient', 'CONSOLIDATED_INVENTORY_AVAILABILITY');
INSERT INTO blc_client_scopes (id, scope) VALUES ('datafeedclient', 'RATING_DETAIL');
INSERT INTO blc_client_scopes (id, scope) VALUES ('datafeedclient', 'PRODUCT_IGNORE_NARROWING');