#NEWLINE# def delete_rbac_policy( self , context , id ) : #NEWLINE# #INDENT# entry = self . _get_rbac_policy ( context , id ) #NEWLINE# object_type = entry [ 'object_type' ] #NEWLINE# try : #NEWLINE# #INDENT# registry . notify ( RBAC_POLICY , events . BEFORE_DELETE , self , context = context , object_type = object_type , policy = entry ) #NEWLINE# #UNINDENT# except c_exc . CallbackFailure as ex : #NEWLINE# #INDENT# raise ext_rbac . RbacPolicyInUse ( object_id = entry [ 'object_id' ] , details = ex ) #NEWLINE# #UNINDENT# with context . session . begin ( subtransactions = True ) : #NEWLINE# #INDENT# context . session . delete ( entry ) #NEWLINE# #UNINDENT# self . object_type_cache . pop ( id , None )