[PATCH] sql: Update permissions on grant-all scripts

Stephen Finucane stephen at that.guru
Mon Apr 10 04:08:49 AEST 2017


Allow access to Submission, CoverLetter, Series, SeriesReference and
SeriesPatch.

Signed-off-by: Stephen Finucane <stephen at that.guru>
Cc: Jeremy Kerr <jk at ozlabs.org>
---
 lib/sql/grant-all.mysql.sql    | 14 ++++++++++++--
 lib/sql/grant-all.postgres.sql | 23 ++++++++++++++++++++++-
 2 files changed, 34 insertions(+), 3 deletions(-)

diff --git a/lib/sql/grant-all.mysql.sql b/lib/sql/grant-all.mysql.sql
index 12dc5ca..5a297b8 100644
--- a/lib/sql/grant-all.mysql.sql
+++ b/lib/sql/grant-all.mysql.sql
@@ -20,7 +20,12 @@ GRANT SELECT, UPDATE, INSERT, DELETE ON patchwork_userprofile_maintainer_project
 GRANT SELECT, UPDATE, INSERT, DELETE ON patchwork_project TO 'www-data'@localhost;
 GRANT SELECT, UPDATE, INSERT, DELETE ON patchwork_bundle TO 'www-data'@localhost;
 GRANT SELECT, UPDATE, INSERT, DELETE ON patchwork_bundlepatch TO 'www-data'@localhost;
+GRANT SELECT, UPDATE, INSERT, DELETE ON patchwork_submission TO 'www-data'@localhost;
 GRANT SELECT, UPDATE, INSERT, DELETE ON patchwork_patch TO 'www-data'@localhost;
+GRANT SELECT, UPDATE, INSERT, DELETE ON patchwork_coverletter TO 'www-data'@localhost;
+GRANT SELECT, UPDATE, INSERT, DELETE ON patchwork_series TO 'www-data'@localhost;
+GRANT SELECT, UPDATE, INSERT, DELETE ON patchwork_seriespatch TO 'www-data'@localhost;
+GRANT SELECT, UPDATE, INSERT, DELETE ON patchwork_seriesreference TO 'www-data'@localhost;
 GRANT SELECT, UPDATE, INSERT, DELETE ON patchwork_emailoptout TO 'www-data'@localhost;
 GRANT SELECT, UPDATE, INSERT, DELETE ON patchwork_patchchangenotification TO 'www-data'@localhost;
 GRANT SELECT, UPDATE, INSERT, DELETE ON patchwork_tag TO 'www-data'@localhost;
@@ -28,8 +33,14 @@ GRANT SELECT, UPDATE, INSERT, DELETE ON patchwork_patchtag TO 'www-data'@localho
 GRANT SELECT, UPDATE, INSERT, DELETE ON patchwork_check TO 'www-data'@localhost;
 GRANT SELECT, UPDATE, INSERT, DELETE ON patchwork_delegationrule TO 'www-data'@localhost;
 
--- allow the mail user (in this case, 'nobody') to add patches
+-- allow the mail user (in this case, 'nobody') to add submissions (patches,
+-- cover letters) and series
+GRANT INSERT, SELECT ON patchwork_submission TO 'nobody'@localhost;
 GRANT INSERT, SELECT ON patchwork_patch TO 'nobody'@localhost;
+GRANT INSERT, SELECT ON patchwork_coverletter TO 'nobody'@localhost;
+GRANT INSERT, SELECT ON patchwork_series TO 'nobody'@localhost;
+GRANT INSERT, SELECT ON patchwork_seriespatch TO 'nobody'@localhost;
+GRANT INSERT, SELECT ON patchwork_seriesreference TO 'nobody'@localhost;
 GRANT INSERT, SELECT ON patchwork_comment TO 'nobody'@localhost;
 GRANT INSERT, SELECT ON patchwork_person TO 'nobody'@localhost;
 GRANT INSERT, SELECT, UPDATE, DELETE ON patchwork_patchtag TO 'nobody'@localhost;
@@ -39,4 +50,3 @@ GRANT SELECT ON patchwork_tag TO 'nobody'@localhost;
 GRANT SELECT ON patchwork_delegationrule TO 'nobody'@localhost;
 
 COMMIT;
-
diff --git a/lib/sql/grant-all.postgres.sql b/lib/sql/grant-all.postgres.sql
index 7cc396e..405ba44 100644
--- a/lib/sql/grant-all.postgres.sql
+++ b/lib/sql/grant-all.postgres.sql
@@ -21,7 +21,12 @@ GRANT SELECT, UPDATE, INSERT, DELETE ON
 	patchwork_project,
 	patchwork_bundle,
 	patchwork_bundlepatch,
+	patchwork_submission,
 	patchwork_patch,
+	patchwork_coverletter,
+	patchwork_series,
+	patchwork_seriespatch,
+	patchwork_seriesreference,
 	patchwork_emailoptout,
 	patchwork_patchchangenotification,
 	patchwork_tag,
@@ -42,7 +47,12 @@ GRANT SELECT, UPDATE ON
 	patchwork_bundle_id_seq,
 	patchwork_bundlepatch_id_seq,
 	patchwork_comment_id_seq,
+	patchwork_submission_id_seq,
 	patchwork_patch_id_seq,
+	patchwork_coverletter_id_seq,
+	patchwork_series_id_seq,
+	patchwork_seriespatch_id_seq,
+	patchwork_seriesreference_id_seq,
 	patchwork_person_id_seq,
 	patchwork_project_id_seq,
 	patchwork_state_id_seq,
@@ -55,9 +65,15 @@ GRANT SELECT, UPDATE ON
 	patchwork_delegationrule_id_seq
 TO "www-data";
 
--- allow the mail user (in this case, 'nobody') to add patches
+-- allow the mail user (in this case, 'nobody') to add submissions (patches,
+-- cover letters) and series
 GRANT INSERT, SELECT ON
+	patchwork_submission,
 	patchwork_patch,
+	patchwork_coverletter,
+	patchwork_series,
+	patchwork_seriespatch,
+	patchwork_seriesreference,
 	patchwork_comment,
 	patchwork_person
 TO "nobody";
@@ -71,7 +87,12 @@ GRANT SELECT ON
 	patchwork_delegationrule
 TO "nobody";
 GRANT UPDATE, SELECT ON
+	patchwork_submission_id_seq,
 	patchwork_patch_id_seq,
+	patchwork_coverletter_id_seq,
+	patchwork_series_id_seq,
+	patchwork_seriespatch_id_seq,
+	patchwork_seriesreference_id_seq,
 	patchwork_person_id_seq,
 	patchwork_comment_id_seq,
 	patchwork_patchtag_id_seq
-- 
2.9.3



More information about the Patchwork mailing list