core(minor): add separate permission to reset user's password
This commit is contained in:
parent
a53f7a49ac
commit
3185a86b22
|
@ -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()
|
||||
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"""
|
||||
|
||||
|
|
Reference in New Issue