# -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-08-03 14:14
from __future__ import unicode_literals

from django.db import migrations

from bluebottle.utils.utils import update_group_permissions


def add_group_permissions(apps, schema_editor):
    group_perms = {
        'Staff': {
            'perms': (
                'add_reward', 'change_reward', 'delete_reward',
            )
        },
        'Anonymous': {
            'perms': ('api_read_reward',)
        },
        'Authenticated': {
            'perms': (
                'api_read_reward', 'api_add_reward', 'api_change_reward', 'api_delete_reward',
            )
        }
    }
    update_group_permissions('rewards', group_perms, apps)


class Migration(migrations.Migration):

    dependencies = [
        ('rewards', '0003_add_api_permissions'),
    ]

    operations = [
            migrations.RunPython(add_group_permissions)
    ]
