3 # shell script to grant privileges to the bacula database
8 if $bindir/psql -f - -d bacula $* <<END-OF-DATA
13 grant all on unsavedfiles to ${USER};
14 grant all on basefiles to ${USER};
15 grant all on jobmedia to ${USER};
16 grant all on file to ${USER};
17 grant all on job to ${USER};
18 grant all on media to ${USER};
19 grant all on client to ${USER};
20 grant all on pool to ${USER};
21 grant all on fileset to ${USER};
22 grant all on path to ${USER};
23 grant all on filename to ${USER};
24 grant all on counters to ${USER};
25 grant all on version to ${USER};
26 grant all on cdimages to ${USER};
27 grant all on mediatype to ${USER};
28 grant all on storage to ${USER};
29 grant all on device to ${USER};
31 -- for sequences on those tables
33 grant select, update on filename_filenameid_seq to ${USER};
34 grant select, update on path_pathid_seq to ${USER};
35 grant select, update on fileset_filesetid_seq to ${USER};
36 grant select, update on pool_poolid_seq to ${USER};
37 grant select, update on client_clientid_seq to ${USER};
38 grant select, update on media_mediaid_seq to ${USER};
39 grant select, update on job_jobid_seq to ${USER};
40 grant select, update on file_fileid_seq to ${USER};
41 grant select, update on jobmedia_jobmediaid_seq to ${USER};
42 grant select, update on basefiles_baseid_seq to ${USER};
43 grant select, update on storage_storageid_seq to ${USER};
44 grant select, update on mediatype_mediatypeid_seq to ${USER};
45 grant select, update on device_deviceid_seq to ${USER};
50 echo "Privileges for ${USER} granted."
53 echo "Error creating privileges."