Inital commit
[patchwork] / lib / sql / grant-all.sql
1 BEGIN;
2 -- give necessary permissions to the web server. Becuase the admin is all
3 -- web-based, these need to be quite permissive
4 GRANT SELECT, UPDATE, INSERT, DELETE ON
5         auth_message,
6         django_session,
7         django_site,
8         django_admin_log,
9         django_content_type,
10         auth_group_permissions,
11         auth_user,
12         auth_user_groups,
13         auth_group,
14         auth_user_user_permissions,
15         auth_permission,
16         patchwork_registrationrequest,
17         patchwork_userpersonconfirmation,
18         patchwork_state,
19         patchwork_comment,
20         patchwork_person,
21         patchwork_userprofile,
22         patchwork_userprofile_maintainer_projects,
23         patchwork_project,
24         patchwork_bundle,
25         patchwork_bundle_patches,
26         patchwork_patch
27 TO "www-data";
28 GRANT SELECT, UPDATE ON
29         auth_group_id_seq,
30         auth_group_permissions_id_seq,
31         auth_message_id_seq,
32         auth_permission_id_seq,
33         auth_user_groups_id_seq,
34         auth_user_id_seq,
35         auth_user_user_permissions_id_seq,
36         django_admin_log_id_seq,
37         django_content_type_id_seq,
38         django_site_id_seq,
39         patchwork_bundle_id_seq,
40         patchwork_bundle_patches_id_seq,
41         patchwork_comment_id_seq,
42         patchwork_patch_id_seq,
43         patchwork_person_id_seq,
44         patchwork_project_id_seq,
45         patchwork_registrationrequest_id_seq,
46         patchwork_state_id_seq,
47         patchwork_userpersonconfirmation_id_seq,
48         patchwork_userprofile_id_seq,
49         patchwork_userprofile_maintainer_projects_id_seq
50 TO "www-data";
51
52 -- allow the mail user (in this case, 'nobody') to add patches
53 GRANT INSERT, SELECT ON
54         patchwork_patch,
55         patchwork_comment,
56         patchwork_person
57 TO "nobody";
58 GRANT SELECT ON
59         patchwork_project
60 TO "nobody";
61 GRANT UPDATE, SELECT ON
62         patchwork_patch_id_seq,
63         patchwork_person_id_seq,
64         patchwork_comment_id_seq
65 TO "nobody";
66
67 COMMIT;
68