def delete(self, uuid=None, perimeter_id=None, user_id=None): """Delete a subject for a given policy :param uuid: uuid of the policy :param perimeter_id: uuid of the subject :param user_id: user ID who do the request :return: { "subject_id": { "name": "name of the subject", "keystone_id": "keystone id of the subject", "description": "description of the subject", "password": "******", "email": "email address of the subject" } } :internal_api: delete_subject """ try: data = PolicyManager.delete_subject(user_id=user_id, policy_id=uuid, perimeter_id=perimeter_id) except Exception as e: logger.error(e, exc_info=True) return {"result": False, "error": str(e)}, 500 return {"result": True}
def delete(self, uuid=None, perimeter_id=None, user_id=None): """Delete a subject for a given policy :param uuid: uuid of the policy (mandatory if perimeter_id is not set) :param perimeter_id: uuid of the subject (mandatory if uuid is not set) :param user_id: user ID who do the request :return: { "subject_id": { "name": "name of the subject", "keystone_id": "keystone id of the subject", "description": "description of the subject (optional)", "password": "******", "email": "email address of the subject (optional)" } } :internal_api: delete_subject """ data = PolicyManager.delete_subject(user_id=user_id, policy_id=uuid, perimeter_id=perimeter_id) return {"result": True}
def delete_subject(policy_id, perimeter_id): from python_moondb.core import PolicyManager PolicyManager.delete_subject("", policy_id, perimeter_id)