#NEWLINE# def dispatch( self , request , * args , **kwargs ) : #NEWLINE# #INDENT# space = get_object_or_404 ( Space , url = kwargs [ 'space_url' ] ) #NEWLINE# doc = get_object_or_404 ( Document , pk = kwargs [ 'doc_id' ] ) #NEWLINE# if ( request . user . has_perm ( 'admin_space' , space ) or request . user . has_perm ( 'mod_space' ) ) : #NEWLINE# #INDENT# return super ( DeleteDocument , self ) . dispatch ( request , * args , ** kwargs ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise PermissionDenied