CaptainHoangLe commented on issue #9448: URL: https://github.com/apache/superset/issues/9448#issuecomment-762670257
> from superset.security import SupersetSecurityManager > class CustomSsoSecurityManager(SupersetSecurityManager): > def add_user( > self, > username, > first_name, > last_name, > email, > role, > password="", > hashed_password="", > time_zone="" > ): > For anyone who runs into a similar issue, I resolved this by overriding the `User` class from `flask_appbuilder.security.sqla.models`. > > ``` > from flask_appbuilder.security.sqla.models import User > from sqlalchemy import ( > Column, > String > ) > class CustomUser(User): > __tablename__ = "ab_user" > time_zone = Column(String(64)) > ``` > > This adds `time_zone` to the schema for `ab_user`. > After this, override the `add_user` function from class `SupersetSecurityManager`. Note that if you're implementing auth through an external OAuth provider, you'd already be doing this. > > ``` > from superset.security import SupersetSecurityManager > class CustomSsoSecurityManager(SupersetSecurityManager): > def add_user( > self, > username, > first_name, > last_name, > email, > role, > password="", > hashed_password="", > time_zone="" > ): > ``` Can you give me detail resolution ? Thank you very much ! ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
