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_r254459134
##########
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:
There is a table called ab_user_role which has done join between ab_user and
ab_role. What will happen to that table in this case?
----------------------------------------------------------------
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