add auth levels
This commit is contained in:
parent
b640f5b334
commit
90c7daaa8a
|
@ -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')),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
]
|
|
@ -1,3 +1,4 @@
|
||||||
|
from django.contrib.auth.models import Group
|
||||||
from django.db import models
|
from django.db import models
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import ugettext_lazy as _
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
|
@ -20,3 +21,10 @@ class UserSAMLIdentifier(models.Model):
|
||||||
verbose_name = _('user SAML identifier')
|
verbose_name = _('user SAML identifier')
|
||||||
verbose_name_plural = _('users SAML identifiers')
|
verbose_name_plural = _('users SAML identifiers')
|
||||||
unique_together = (('issuer', 'name_id'),)
|
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)
|
||||||
|
|
Loading…
Reference in New Issue