#NEWLINE# def perform_destroy( self , instance ) : #NEWLINE# #INDENT# affected_user = affected_project_group . user #NEWLINE# affected_project_group = instance . group . projectgrouprole . project_group #NEWLINE# role = instance . group . projectgrouprole . role_type #NEWLINE# if ( not self . can_manage_roles_for ( affected_project_group ) ) : #NEWLINE# #INDENT# raise PermissionDenied ( 'You do not have permission to perform this action.' ) #NEWLINE# #UNINDENT# affected_project_group . remove_user ( affected_user , role )