Merge lp:~danilo/launchpad/bug-790088 into lp:launchpad

Proposed by Данило Шеган
Status: Merged
Approved by: Graham Binns
Approved revision: no longer in the source branch.
Merged at revision: 13437
Proposed branch: lp:~danilo/launchpad/bug-790088
Merge into: lp:launchpad
Diff against target: 33 lines (+9/-2)
2 files modified
database/schema/security.cfg (+1/-0)
lib/lp/registry/doc/person-notification.txt (+8/-2)
To merge this branch: bzr merge lp:~danilo/launchpad/bug-790088
Reviewer Review Type Date Requested Status
Graham Binns (community) code Approve
Review via email: mp+67938@code.launchpad.net

Commit message

[r=gmb][bug=790088] Add SELECT permission on account table for personnotification user so it could send emails to teams owners who are teams themselves.

Description of the change

= Bug 790088 =

send-person-notification.py fails for teams owned by other teams because access to "account" table for the DB user a script runs under ("personnotification") is impossible.

We add the "SELECT" privilege on "account" table for that user.

== Tests ==

bin/test -cvvt person-notification.txt

== Demo and Q/A ==

Merge a team owned by a team into another team and try out cronscripts/send-person-notifications.py.

= Launchpad lint =

Checking for conflicts and issues in changed files.

Linting changed files:
  database/schema/security.cfg
  lib/lp/registry/doc/person-notification.txt

To post a comment you must log in.
Revision history for this message
Graham Binns (gmb) :
review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'database/schema/security.cfg'
2--- database/schema/security.cfg 2011-07-08 18:46:51 +0000
3+++ database/schema/security.cfg 2011-07-14 10:11:40 +0000
4@@ -1538,6 +1538,7 @@
5
6 [personnotification]
7 groups=script
8+public.account = SELECT
9 public.emailaddress = SELECT
10 public.libraryfilealias = SELECT
11 public.libraryfilecontent = SELECT
12
13=== modified file 'lib/lp/registry/doc/person-notification.txt'
14--- lib/lp/registry/doc/person-notification.txt 2011-05-19 04:18:07 +0000
15+++ lib/lp/registry/doc/person-notification.txt 2011-07-14 10:11:40 +0000
16@@ -66,9 +66,15 @@
17
18 >>> notification = notification_set.addNotification(
19 ... mark, 'subject2', 'body2')
20+
21+This includes notifications to teams owned by other teams.
22+
23+ >>> owning_team = factory.makeTeam()
24+ >>> team = factory.makeTeam(owner=owning_team)
25+ >>> team_notification = notification_set.addNotification(
26+ ... team, 'subject3', 'body3')
27 >>> [n.subject for n in notification_set.getNotificationsToSend()]
28- [u'subject2']
29-
30+ [u'subject2', u'subject3']
31 >>> transaction.commit()
32
33 >>> import subprocess