[Plugin] user: Added permissions to model
This commit is contained in:
parent
1246ce50fd
commit
2daa79ee15
|
@ -1,5 +1,5 @@
|
||||||
from flask import url_for
|
from flask import url_for
|
||||||
from typing import Optional
|
from typing import Optional, Type
|
||||||
from datetime import date, datetime
|
from datetime import date, datetime
|
||||||
from sqlalchemy.orm.collections import attribute_mapped_collection
|
from sqlalchemy.orm.collections import attribute_mapped_collection
|
||||||
|
|
||||||
|
@ -56,6 +56,7 @@ class User(db.Model, ModelSerializeMixin):
|
||||||
mail: str = db.Column(db.String(60), nullable=False)
|
mail: str = db.Column(db.String(60), nullable=False)
|
||||||
birthday: Optional[date] = db.Column(db.Date)
|
birthday: Optional[date] = db.Column(db.Date)
|
||||||
roles: [str] = []
|
roles: [str] = []
|
||||||
|
permissions: Optional[type([str])] = None
|
||||||
avatar_url: Optional[str] = ""
|
avatar_url: Optional[str] = ""
|
||||||
|
|
||||||
roles_: [Role] = db.relationship("Role", secondary=association_table, cascade="save-update, merge")
|
roles_: [Role] = db.relationship("Role", secondary=association_table, cascade="save-update, merge")
|
||||||
|
|
Loading…
Reference in New Issue