Skip to content

Commit 321b96c

Browse files
Matthew Fishercarmstrong
authored andcommitted
feat(controller): allow shared users domain access
1 parent 6886795 commit 321b96c

2 files changed

Lines changed: 2 additions & 5 deletions

File tree

controller/api/tests/test_domain.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,14 @@ def test_manage_domain_invalid_app(self):
6565
response = self.client.get(url, content_type='application/json')
6666
self.assertEqual(response.status_code, 404)
6767

68-
def test_manage_domain_no_perms_on_app(self):
68+
def test_manage_domain_perms_on_app(self):
6969
self.client.logout()
7070
self.assertTrue(
7171
self.client.login(username='autotest2', password='password'))
7272
url = '/api/apps/{app_id}/domains'.format(app_id=self.app_id)
7373
body = {'domain': 'test-domain2.example.com'}
7474
response = self.client.post(url, json.dumps(body), content_type='application/json')
75-
self.assertEqual(response.status_code, 403)
75+
self.assertEqual(response.status_code, 201)
7676

7777
def test_manage_domain_invalid_domain(self):
7878
url = '/api/apps/{app_id}/domains'.format(app_id=self.app_id)

controller/api/views.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -466,9 +466,6 @@ class DomainViewSet(OwnerViewSet):
466466

467467
def create(self, request, *args, **kwargs):
468468
app = get_object_or_404(models.App, id=self.kwargs['id'])
469-
# TODO: allow non-owners to manage domains
470-
if request.user != app.owner:
471-
return Response(status=status.HTTP_403_FORBIDDEN)
472469
request._data = request.DATA.copy()
473470
request.DATA['app'] = app
474471
return super(DomainViewSet, self).create(request, *args, **kwargs)

0 commit comments

Comments
 (0)