#NEWLINE# @ login_required #NEWLINE# @ permission_required ( 'admin.add_domain' ) #NEWLINE# def remove_permission( request ) : #NEWLINE# #INDENT# domid = request . GET . get ( 'domid' , None ) #NEWLINE# daid = request . GET . get ( 'daid' , None ) #NEWLINE# if ( ( domid is None ) or ( daid is None ) ) : #NEWLINE# #INDENT# raise BadRequest ( _ ( 'Invalid request' ) ) #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# account = User . objects . get ( pk = daid ) #NEWLINE# domain = Domain . objects . get ( pk = domid ) #NEWLINE# #UNINDENT# except ( User . DoesNotExist , Domain . DoesNotExist ) : #NEWLINE# #INDENT# raise BadRequest ( _ ( 'Invalid request' ) ) #NEWLINE# #UNINDENT# if ( ( not request . user . can_access ( account ) ) or ( not request . user . can_access ( domain ) ) ) : #NEWLINE# #INDENT# raise PermDeniedException #NEWLINE# #UNINDENT# domain . remove_admin ( account ) #NEWLINE# return render_to_json_response ( { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } )