ephraimbuddy commented on a change in pull request #14840:
URL: https://github.com/apache/airflow/pull/14840#discussion_r598584571



##########
File path: airflow/api_connexion/endpoints/role_and_permission_endpoint.py
##########
@@ -64,3 +66,70 @@ def get_permissions(limit=None, offset=None):
     query = session.query(Permission)
     actions = query.offset(offset).limit(limit).all()
     return action_collection_schema.dump(ActionCollection(actions=actions, 
total_entries=total_entries))
+
+
[email protected]_access([(permissions.ACTION_CAN_DELETE, 
permissions.RESOURCE_ROLE_MODEL_VIEW)])
+def delete_role(role_name):
+    """Delete a role"""
+    ab_security_manager = current_app.appbuilder.sm
+    role = ab_security_manager.find_role(name=role_name)
+    if not role:
+        raise NotFound(title="Role not found", detail=f"The Role with name 
`{role_name}` was not found")
+    ab_security_manager.delete_role(role_name=role_name)

Review comment:
       Yes, it was added in airflow, see 
https://github.com/apache/airflow/blob/fa92657490bc188d272fb4d8f3b09933815bcea1/airflow/www/security.py#L194-L207




-- 
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]


Reply via email to