# Copyright 2026 EcoFuture Technology Services LLC and contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Generated by Django 5.0.6 on 2024-07-04 12:59

import model_clone.mixin
import uuid
from django.db import migrations, models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Permission',
            fields=[
                ('dt_created', models.DateTimeField(auto_now_add=True, db_index=True, verbose_name='Creation time')),
                ('dt_updated', models.DateTimeField(auto_now=True, db_index=True, verbose_name='Update time')),
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('slug', models.CharField(max_length=255, unique=True, verbose_name='Label')),
            ],
            options={
                'verbose_name': 'Permission',
                'verbose_name_plural': 'Permissions',
                'abstract': False,
            },
            bases=(model_clone.mixin.CloneMixin, models.Model),
        ),
        migrations.CreateModel(
            name='GroupPermission',
            fields=[
                ('dt_created', models.DateTimeField(auto_now_add=True, db_index=True, verbose_name='Creation time')),
                ('dt_updated', models.DateTimeField(auto_now=True, db_index=True, verbose_name='Update time')),
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('slug', models.CharField(max_length=255, unique=True, verbose_name='Label')),
                ('name', models.CharField(max_length=255, verbose_name='Name')),
                ('permissions', models.ManyToManyField(related_name='groups', to='permit.permission', verbose_name='Permissions')),
            ],
            options={
                'verbose_name': 'Permission Group',
                'verbose_name_plural': 'Permission Groups',
                'abstract': False,
            },
            bases=(model_clone.mixin.CloneMixin, models.Model),
        ),
        migrations.CreateModel(
            name='Role',
            fields=[
                ('dt_created', models.DateTimeField(auto_now_add=True, db_index=True, verbose_name='Creation time')),
                ('dt_updated', models.DateTimeField(auto_now=True, db_index=True, verbose_name='Update time')),
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('slug', models.CharField(max_length=255, unique=True, verbose_name='Label')),
                ('name', models.CharField(max_length=255, verbose_name='Name')),
                ('for_anonymous', models.BooleanField(default=False, verbose_name='For Anonymous Users')),
                ('is_system', models.BooleanField(default=False, verbose_name='System Role')),
                ('groups_permission', models.ManyToManyField(blank=True, related_name='roles', to='permit.grouppermission', verbose_name='Permission Groups')),
            ],
            options={
                'verbose_name': 'Role',
                'verbose_name_plural': 'Roles',
                'abstract': False,
            },
            bases=(model_clone.mixin.CloneMixin, models.Model),
        ),
    ]
