/*****************************************************************************
*
* Filename         - $Workfile:   grnts.sql  $
*
*                     Name              Date      Version     CR Number
* Author           - See revision history below.
* Last Update      - See revision history below.
*
* Project Name     - TAGTRAK(Oracle Database)
*
* Source Code
* Identifier       - 0/3/300/8010/112
*
* Design Spec
* Section          -
*
* Contents         - Live Schema: Grants to other users
*
* Language         - Oracle SQL*Plus script
*
* Classification   - Commercial In Confidence
*
*          (c) Ultra Electronics Limited, 1997
*
*****************************************************************************/

/*****************************************************************************
NOTE:any grants on tables in live schema should be put in this script and not 
elsewhere i.e NOT in live_schema/mk_schema.csh or any other script
******************************************************************************/
grant select,delete on bag to arch;
grant select,delete on bag_alert to arch;
grant select,delete on bag_trace to arch;
grant select,delete on bpm_data to arch;
grant select,delete on bpm_status_trace to arch;
grant select,delete on user_trace to arch;
grant select on user_trace to temp;
grant select,delete on stats to arch;
grant select,delete on stats_access to arch;
grant select on carrier_lookup to arch, temp;
grant select on db_config to arch;
grant select on db_version to arch;
grant select on error to arch;
grant references on error to arch;
grant select,update,delete on flight to arch;
grant select,delete on flight_dests to arch;
grant select,delete on flight_status to arch;
grant select on flight_trace to arch;
grant select,delete on fs_events to arch;
grant select on group_iata_dests to arch;
grant select on holds to arch;
grant select on holds to temp;
grant select on interim to arch;
grant select on ldg_strat to arch;
grant select on location to arch;
grant select on location_group to arch;
grant select,delete on log_table to arch;
grant select on mail_global to arch;
grant select on mail_indiv to arch;
grant delete on mail_indiv to arch;
grant select,delete on mba_flights to arch;
grant select,delete on msg_log to arch;
grant select on mws_search_plans to arch;
grant select,delete on onward_flight to arch;
grant select,delete on pax to arch;
grant select on privilege to arch;
grant select on system_cfg to arch;
grant select on tagtrak_users to arch;
grant select,delete on ulds to arch;
grant select,delete on uld_dests to arch;
grant select,delete on uld_trace to arch;
grant select on uld_types to arch;
grant select on user_group to arch;
grant select,delete on flight_access to arch;
grant select,delete on code_share to arch;
grant select,delete on flight_info to arch;
grant select,delete on flight_info_inbound to arch;
grant select,delete on flight_info_extras to arch;
grant select,delete on mach_flight_info to arch;
grant select,delete on fasl_flight_info to arch;
grant select,delete on hel_fids_flight_info to arch;
grant select,delete on weights to arch;
grant select,delete on flight_events to arch;
grant select on agents to arch;
grant select on agents to temp;
grant select on contracted_agents to arch;
grant select,delete on temp_delete_ids to arch;
grant select,delete on lba_info to arch;
grant select,delete on onward_flight to temp;
grant select on location to temp;
grant select on location_group to temp;
grant select on error to temp;
grant references on live.error to temp;
grant select on group_iata_dests to temp;
grant select on mws_search_plans to temp;
grant select on uld_types to temp;
grant select on tagtrak_users to temp;
grant connect to opdb_user;
grant insert,update,select,delete on fasl_flight_info to opdb_user;
grant connect to lba_user;
grant insert,select on lba_info to lba_user;
grant select, delete on prg_fids_info to arch;
grant select on site_info to arch;
grant select on site_info to temp;
grant select on site_config to arch;
grant select on site_config to temp;
grant select, delete on timed_report_config to arch;
grant select, delete on uld_card_templates to arch;
grant select, delete on uld_card_details to arch;
grant select, delete on oracle_error to arch;
grant select, delete on uld_recorded_id_codes to arch;
grant select, delete on hbmd to arch;
grant select, delete on pm_results to arch;
grant select, delete on pm_results to temp;
grant insert,select, delete on eq_log to arch;
grant insert,select, delete on eq_log to temp;
grant select on kit_status to arch;
grant select on kit_status to temp;
grant select,update on kit to arch;
grant select,update on kit to temp;
grant select on translator to arch;
grant select on translator to temp;
grant select, delete on handler_trace to arch;
grant select, delete on tracking_log to arch;
grant select on kit_type to arch;
grant select on kit_type to temp;
grant select on unauthorised_bag to arch;
grant select on unauthorised_bag to temp;
grant select, delete on reflight_bag to arch;
grant select on reflight_bag to temp;
grant select, delete on reflight_pax to arch;
grant select on reflight_pax to temp;
grant select, delete on reflight_ulds to arch;
grant select on reflight_ulds to temp;
grant select, delete on reflight_flight to arch;
grant select on reflight_flight to temp;
grant select, delete on unknown_bag to arch;
grant select, delete on unknown_bag to temp;

grant select on db_config to temp;

-- UAS/FALCP/CA/00771
GRANT SELECT  ON uld_card_details      TO arch;
GRANT SELECT  ON uld_recorded_id_codes TO arch;
GRANT SELECT  ON uld_card_details      TO temp;
GRANT SELECT  ON uld_recorded_id_codes TO temp;

grant select, insert, update, delete on location to arch;
grant select, insert, update, delete on tracking_events to arch;
grant select, insert, update, delete on bag_status to arch;
grant select on user_role to arch;

grant select, insert, update, delete on location to temp;
grant select, insert, update, delete on tracking_events to temp;
grant select, insert, update, delete on bag_status to temp;
grant select on user_role to temp;

grant all on bag_exception_types to temp;
grant all on bag_exception_types to arch;

--email_trace table never archived but arch needs to periodically delete expired entries from it
--records inserted by arch and temp when user sends emails from these schemas 
GRANT SELECT,DELETE,INSERT ON email_trace TO arch;
GRANT SELECT,INSERT ON email_trace TO temp;

GRANT SELECT ON reports TO arch;
GRANT SELECT ON reports TO temp;

GRANT SELECT ON email_accounts TO arch;
GRANT SELECT ON email_accounts TO temp;

GRANT SELECT ON email_addresses TO arch;
GRANT SELECT ON email_addresses TO temp;

GRANT SELECT, DELETE ON inbound_pax TO arch;
GRANT SELECT, DELETE ON inbound_pax_onward_dests TO arch;
GRANT SELECT, DELETE ON inbound_uld TO arch;
GRANT SELECT, DELETE ON inbound_uld_dests TO arch;
GRANT SELECT, DELETE ON inbound_bag TO arch;

GRANT SELECT, DELETE ON messages TO arch;
GRANT SELECT, DELETE ON message_parts TO arch;
GRANT SELECT, DELETE ON messages_trace TO arch;


