GRANT ALL ON SCHEMA bdip TO lesia;
grant all on schema bdip to gavoadmin;
grant usage on schema bdip to gavo;
grant usage on schema bdip to untrusted;

grant select on bdip_all, 
	bdip_dataset,
	bdip_files,
	bdip_jupiter, 
	bdip_saturne, 
	bdip_mars, 
	bdip_venus, 
	bdip_mercure, 
	observatoires to public, gavo;

alter view bdip_all owner to gavoadmin;
alter view bdip_dataset owner to gavoadmin;
alter view bdip_files owner to gavoadmin;
alter table bdip_jupiter owner to gavoadmin;
alter table bdip_saturne owner to gavoadmin;
alter table bdip_mars owner to gavoadmin;
alter table bdip_venus owner to gavoadmin;
alter table bdip_mercure owner to gavoadmin;
alter table observatoires  owner to gavoadmin;

grant all on bdip_all, 
	bdip_dataset,
	bdip_files,
	bdip_jupiter, 
	bdip_saturne, 
	bdip_mars, 
	bdip_venus, 
	bdip_mercure, 
	observatoires to lesia;

-- epn_core

alter view epn_core owner to gavoadmin;

REVOKE ALL ON  epn_core FROM PUBLIC;
REVOKE ALL ON  epn_core FROM postgres;
GRANT ALL ON  epn_core TO postgres;
GRANT ALL ON  epn_core TO gavoadmin WITH GRANT OPTION;
GRANT ALL ON  epn_core TO gavo WITH GRANT OPTION;

GRANT SELECT ON  epn_core TO untrusted;
GRANT SELECT ON  epn_core TO gavo;
GRANT ALL ON  epn_core TO lesia ;
GRANT ALL ON  epn_core TO gavoadmin;


-- pour faire des modifs
-- alter view epn_core owner to lesia;
-- alter view bdip_dataset owner to lesia;

