# Generated by Django 2.1.1 on 2018-12-07 22:07

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    dependencies = [
        ('mapdata', '0001_squashed_2018'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('control', '0005_editor_mapdata_permissions'),
    ]

    operations = [
        migrations.CreateModel(
            name='UserSpaceAccess',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('can_edit', models.BooleanField(default=False, verbose_name='can edit')),
                ('space', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='spaceaccesses', to='mapdata.Space')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='spaceaccesses', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'user space access',
                'verbose_name_plural': 'user space accesses',
                'default_related_name': 'spaceaccesses',
            },
        ),
        migrations.AddField(
            model_name='userpermissions',
            name='grant_space_access',
            field=models.BooleanField(default=False, verbose_name='can grant space access'),
        ),
        migrations.AlterUniqueTogether(
            name='userspaceaccess',
            unique_together={('user', 'space')},
        ),
    ]
