'Test that Bobby can set the permissions only only on the ones
for which he has the right'

def test_bobby_cannot_set_all(self):

    layer = Layer.objects.all()[0]
    self.client.login(username='admin', password='admin')
    assign_perm('change_resourcebase', Profile.objects.get(username='bobby'), layer.get_self_resource())
    self.client.logout()
    self.client.login(username='bobby', password='bob')
    layer2 = Layer.objects.all()[1]
    data = {'permissions': json.dumps({'users': {'bobby': ['view_resourcebase']}, 'groups': {}}), 'resources': [layer.id, layer2.id]}
    resp = self.client.post(self.bulk_perms_url, data)
    self.assertTrue((layer2.title in json.loads(resp.content)['not_changed']))
