add auth levels

This commit is contained in:
Valentin Deniaud 2019-03-28 17:03:51 +01:00
parent b640f5b334
commit 90c7daaa8a
2 changed files with 32 additions and 0 deletions

View File

@ -0,0 +1,24 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2019-03-28 16:52
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('mellon', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='AuthenticationLevel',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('value', models.PositiveSmallIntegerField(default=1)),
('group', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='auth_level', to='auth.Group')),
],
),
]

View File

@ -1,3 +1,4 @@
from django.contrib.auth.models import Group
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.conf import settings
@ -20,3 +21,10 @@ class UserSAMLIdentifier(models.Model):
verbose_name = _('user SAML identifier')
verbose_name_plural = _('users SAML identifiers')
unique_together = (('issuer', 'name_id'),)
class AuthenticationLevel(models.Model):
group = models.OneToOneField(Group, related_name='auth_level')
# ou plutot laisser blanc pour qu'il y ait une erreur si on
# a pas recu les niveaux ?
value = models.PositiveSmallIntegerField(default=1)