Skip to content

Commit fd9bf10

Browse files
authored
Role + grants for reading + writing SSX acquisition metadata (#168)
* Role and grants for writing SSX acquisition metadata * Include running the grants in build.sh + instructions in README.md * Grants for new SSX tables to read-only 'no PII' role
1 parent 1fc17ae commit fd9bf10

File tree

4 files changed

+37
-0
lines changed

4 files changed

+37
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ mysql ispyb < grants/ispyb_import.sql
4545
mysql ispyb < grants/ispyb_processing.sql
4646
mysql ispyb < grants/ispyb_ro_nopii.sql
4747
mysql ispyb < grants/ispyb_scripts_processing.sql
48+
mysql ispyb < grants/ispyb_ssx_writer.sql
4849
mysql ispyb < grants/ispyb_touchscreen.sql
4950
mysql ispyb < grants/ispyb_web.sql
5051
mysql ispyb < grants/ispyb_web_verify_tests.sql

build.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ then
3434
mysql --defaults-file=.my.cnf -D $DB < grants/ispyb_touchscreen.sql
3535
mysql --defaults-file=.my.cnf -D $DB < grants/ispyb_web.sql
3636
mysql --defaults-file=.my.cnf -D $DB < grants/ispyb_web_verify_tests.sql
37+
mysql --defaults-file=.my.cnf -D $DB < grants/ispyb_ssx_writer.sql
3738

3839
arr=$(bin/missed_updates.sh)
3940

grants/ispyb_ro_nopii.sql

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,3 +225,10 @@ GRANT SELECT ON ParticleClassification_has_CryoemInitialModel TO ispyb_ro_nopii;
225225
GRANT SELECT ON RelativeIceThickness TO ispyb_ro_nopii;
226226
GRANT SELECT ON Tomogram TO ispyb_ro_nopii;
227227
GRANT SELECT ON TiltImageAlignment TO ispyb_ro_nopii;
228+
GRANT SELECT ON SSXDataCollection TO ispyb_ro_nopii;
229+
GRANT SELECT ON Component TO ispyb_ro_nopii;
230+
GRANT SELECT ON SampleComposition TO ispyb_ro_nopii;
231+
GRANT SELECT ON CrystalComposition TO ispyb_ro_nopii;
232+
GRANT SELECT ON EventChain TO ispyb_ro_nopii;
233+
GRANT SELECT ON EventType TO ispyb_ro_nopii;
234+
GRANT SELECT ON Event TO ispyb_ro_nopii;

grants/ispyb_ssx_writer.sql

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
CREATE ROLE IF NOT EXISTS ispyb_ssx_writer;
2+
3+
-- You also need to create a database user and grant this role to them, e.g.
4+
-- CREATE USER ispyb_ssx_server@'%' IDENTIFIED BY 'the_password';
5+
-- GRANT ispyb_ssx_writer TO ispyb_ssx_server@'%';
6+
-- SET DEFAULT ROLE ispyb_ssx_writer FOR ispyb_ssx_server@'%';
7+
8+
GRANT SELECT ON Proposal TO ispyb_ssx_writer;
9+
GRANT SELECT ON BLSession TO ispyb_ssx_writer;
10+
11+
GRANT SELECT ON ExperimentType TO ispyb_ssx_writer;
12+
GRANT SELECT ON ComponentType TO ispyb_ssx_writer;
13+
GRANT SELECT ON ConcentrationType TO ispyb_ssx_writer;
14+
GRANT SELECT ON EventType TO ispyb_ssx_writer;
15+
16+
GRANT EXECUTE ON PROCEDURE upsert_dc_group_v3 TO ispyb_ssx_writer;
17+
GRANT EXECUTE ON PROCEDURE upsert_dc TO ispyb_ssx_writer;
18+
19+
GRANT SELECT, INSERT, UPDATE ON SSXDataCollection TO ispyb_ssx_writer;
20+
GRANT SELECT, INSERT, UPDATE ON DataCollectionGroup TO ispyb_ssx_writer;
21+
GRANT SELECT, INSERT, UPDATE ON DataCollection TO ispyb_ssx_writer;
22+
23+
GRANT SELECT, INSERT, UPDATE ON EventChain TO ispyb_ssx_writer;
24+
GRANT SELECT, INSERT, UPDATE ON Event TO ispyb_ssx_writer;
25+
26+
GRANT SELECT, INSERT, UPDATE ON Component TO ispyb_ssx_writer;
27+
GRANT SELECT, INSERT, UPDATE ON SampleComposition TO ispyb_ssx_writer;
28+
GRANT SELECT, INSERT, UPDATE ON CrystalComposition TO ispyb_ssx_writer;

0 commit comments

Comments
 (0)