feng-tao commented on a change in pull request #4658: [WIP] [AIRFLOW-3813] Add
CLI commands to manage roles
URL: https://github.com/apache/airflow/pull/4658#discussion_r254457699
##########
File path: airflow/www/security.py
##########
@@ -195,6 +195,19 @@ def init_role(self, role_name, role_vms, role_perms):
else:
self.log.info('Existing permissions for the role:%s within the
database will persist.', role_name)
+ def delete_role(self, role_name):
+ session = self.get_session
+ role = session.query(sqla_models.Role)\
+ .filter(sqla_models.Role.name == role_name)\
+ .first()
+ if role:
+ self.log.info("Deleting role '{}'".format(role_name))
+ session.delete(role)
Review comment:
I am wondering what will happen if a user's role gets deleted. Will the user
has a no role in the db?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services