core(minor): add separate permission to reset user's password
This commit is contained in:
parent
a53f7a49ac
commit
3185a86b22
17
passbook/core/migrations/0002_auto_20191010_1058.py
Normal file
17
passbook/core/migrations/0002_auto_20191010_1058.py
Normal 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'),)},
|
||||||
|
),
|
||||||
|
]
|
|
@ -58,6 +58,12 @@ class User(GuardianUserMixin, AbstractUser):
|
||||||
self.password_change_date = now()
|
self.password_change_date = now()
|
||||||
return super().set_password(password)
|
return super().set_password(password)
|
||||||
|
|
||||||
|
class Meta:
|
||||||
|
|
||||||
|
permissions = (
|
||||||
|
('reset_user_password', 'Reset Password'),
|
||||||
|
)
|
||||||
|
|
||||||
class Provider(models.Model):
|
class Provider(models.Model):
|
||||||
"""Application-independent Provider instance. For example SAML2 Remote, OAuth2 Application"""
|
"""Application-independent Provider instance. For example SAML2 Remote, OAuth2 Application"""
|
||||||
|
|
||||||
|
|
Reference in a new issue