added tests to assert team roles attach/unattach permissions, removed previous flawed fix

This commit is contained in:
Wayne Witzel III
2016-04-28 15:15:26 -04:00
parent b6bbd4fa77
commit ef8eb712c6
2 changed files with 19 additions and 4 deletions

View File

@@ -836,10 +836,6 @@ class TeamRolesList(SubListCreateAttachDetachAPIView):
def post(self, request, *args, **kwargs):
# Forbid implicit role creation here
team = get_object_or_404(Team, pk=self.kwargs['pk'])
if not self.request.user.can_access(Team, 'change', team):
raise PermissionDenied()
sub_id = request.data.get('id', None)
if not sub_id:
data = dict(msg='Role "id" field is missing')