bug.transitionToInformationType does not respect BugSharingPolicy

Bug #1039631 reported by Curtis Hovey
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
High
William Grant

Bug Description

This bug extends the work of bug 1036185. The default bug creation rule are enforced, but the transition rules are not enforced.

For example I set bugs are proprietary only.
    https://qastaging.launchpad.net/lp-dev-utils/+sharing

I reported
    https://bugs.qastaging.launchpad.net/lp-dev-utils/+bug/939548

which was proprietary when It was created. The UI would not let me choose another type. I expected an error to be raised when I ran this API function:
def test_bug_sharing_policy():
    lp = Launchpad.login_with(
        'testing', service_root='https://api.qastaging.launchpad.net',
        version='devel')
    bug = lp.bugs['939548']
    bug.transitionToInformationType(
        information_type="Public")

But there was no error, when I refreshed the page, the bug was public, even though the policy says I will not permit it.

This is roughly what I think is missing.

class BugInformationTypeNotPermitted:
    """The information type is forbidden by the project's BugSharingPolicy."""

Bug.transitionToInformationType()
        if information_type not in self.getAllowedBugInformationTypes():
            raise BugSharingPolicyError()

Related branches

Revision history for this message
William Grant (wgrant) wrote :

Right, this is what I was working on yesterday, but there's a fair bit of test fallout.

Changed in launchpad:
assignee: nobody → William Grant (wgrant)
status: Triaged → In Progress
Revision history for this message
Launchpad QA Bot (lpqabot) wrote :
tags: added: qa-needstesting
Changed in launchpad:
status: In Progress → Fix Committed
William Grant (wgrant)
tags: added: qa-ok
removed: qa-needstesting
William Grant (wgrant)
Changed in launchpad:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.