Return-Path: X-Original-To: apmail-allura-commits-archive@www.apache.org Delivered-To: apmail-allura-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D59F010CE0 for ; Fri, 27 Feb 2015 23:18:56 +0000 (UTC) Received: (qmail 20347 invoked by uid 500); 27 Feb 2015 23:18:56 -0000 Delivered-To: apmail-allura-commits-archive@allura.apache.org Received: (qmail 20298 invoked by uid 500); 27 Feb 2015 23:18:56 -0000 Mailing-List: contact commits-help@allura.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@allura.apache.org Delivered-To: mailing list commits@allura.apache.org Received: (qmail 20146 invoked by uid 99); 27 Feb 2015 23:18:56 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 27 Feb 2015 23:18:56 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 6AAF0E0D39; Fri, 27 Feb 2015 23:18:56 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: brondsem@apache.org To: commits@allura.apache.org Date: Fri, 27 Feb 2015 23:19:02 -0000 Message-Id: <3b7cb5ba3fbe49c5b4726b3e3e765475@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [07/14] allura git commit: [#7832] ticket:731 Test for permissions [#7832] ticket:731 Test for permissions Project: http://git-wip-us.apache.org/repos/asf/allura/repo Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/a747991c Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/a747991c Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/a747991c Branch: refs/heads/master Commit: a747991c01a63399d28b10dd579559147022cfb5 Parents: f392d5b Author: Igor Bondarenko Authored: Mon Feb 23 10:34:35 2015 +0000 Committer: Dave Brondsema Committed: Fri Feb 27 22:40:52 2015 +0000 ---------------------------------------------------------------------- Allura/allura/tests/test_webhooks.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/allura/blob/a747991c/Allura/allura/tests/test_webhooks.py ---------------------------------------------------------------------- diff --git a/Allura/allura/tests/test_webhooks.py b/Allura/allura/tests/test_webhooks.py index 50a9803..a336f32 100644 --- a/Allura/allura/tests/test_webhooks.py +++ b/Allura/allura/tests/test_webhooks.py @@ -894,3 +894,17 @@ class TestWebhookRestController(TestRestApiBase): dd.assert_equal(r.json, {u'result': u'ok'}) assert_equal(M.Webhook.query.find().count(), 2) assert_equal(M.Webhook.query.get(_id=webhook._id), None) + + def test_permissions(self): + self.api_get(self.url, user='test-user', status=403) + self.api_get(self.url, user='*anonymous', status=401) + url = self.url + '/repo-push/' + self.api_post(url, user='test-user', status=403) + self.api_post(url, user='*anonymous', status=401) + url = self.url + '/repo-push/' + str(self.webhooks[0]._id) + self.api_get(url, user='test-user', status=403) + self.api_get(url, user='*anonymous', status=401) + self.api_post(url, user='test-user', status=403) + self.api_post(url, user='*anonymous', status=401) + self.api_delete(url, user='test-user', status=403) + self.api_delete(url, user='*anonymous', status=401)