#NEWLINE# @ defer . inlineCallbacks #NEWLINE# def check_can_change_room_list( self , room_id , user ) : #NEWLINE# #INDENT# "Check if the user is allowed to edit the room's entry in the\n        published room list.\n\n        Args:\n            room_id (str)\n            user (UserID)\n        " #NEWLINE# is_admin = ( yield self . is_server_admin ( user ) ) #NEWLINE# if is_admin : #NEWLINE# #INDENT# defer . returnValue ( True ) #NEWLINE# #UNINDENT# user_id = user . to_string ( ) #NEWLINE# ( yield self . check_joined_room ( room_id , user_id ) ) #NEWLINE# power_level_event = ( yield self . state . get_current_state ( room_id , EventTypes . PowerLevels , '' ) ) #NEWLINE# auth_events = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# if power_level_event : #NEWLINE# #INDENT# auth_events [ ( EventTypes . PowerLevels , '' ) ] = power_level_event #NEWLINE# #UNINDENT# send_level = self . _get_send_level ( EventTypes . Aliases , '' , auth_events ) #NEWLINE# user_level = self . _get_user_power_level ( user_id , auth_events ) #NEWLINE# if ( user_level < send_level ) : #NEWLINE# #INDENT# raise AuthError ( 403 , 'This server requires you to be a moderator in the room to edit its room list entry' )