core(minor): add separate permission to reset user's password

This commit is contained in:
Langhammer, Jens 2019-10-10 13:01:36 +02:00
parent a53f7a49ac
commit 3185a86b22
2 changed files with 23 additions and 0 deletions

View file

@ -0,0 +1,17 @@
# Generated by Django 2.2.6 on 2019-10-10 10:58
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('passbook_core', '0001_initial'),
]
operations = [
migrations.AlterModelOptions(
name='user',
options={'permissions': (('reset_user_password', 'Reset Password'),)},
),
]

View file

@ -58,6 +58,12 @@ class User(GuardianUserMixin, AbstractUser):
self.password_change_date = now()
return super().set_password(password)
class Meta:
permissions = (
('reset_user_password', 'Reset Password'),
)
class Provider(models.Model):
"""Application-independent Provider instance. For example SAML2 Remote, OAuth2 Application"""