def execute(self):
        if not self.args:
            self.pc.update_output('Revoke whose authority over what?\n')
            return
        exp = r'(?P<permission>(god)|(dm)|(builder)|(admin))[ ]?(from)?(on)?(for)?([ ]+(?P<player>\w+))'
        match = re.match(exp, self.args.lower(), re.I)
        if not match:
            self.pc.update_output('Type "help revoke" for help on this command.')
            return
        perm, player = match.group('permission', 'player')
        if self.pc.location:
            npc = self.pc.location.get_npc_by_kw(player)
        player = self.world.get_player(player) or npc
        permission = globals().get(perm.upper())
        if not player:
            self.pc.update_output('That player isn\'t on right now.')
            return
        if not permission:
            self.pc.update_output('Valid permission types are: god, dm, builder, and admin.')
            return
        if not (player.permissions & permission):
            self.pc.update_output('%s doesn\'t have that authority anyway.' % player.fancy_name())
            return
        player.permissions = player.permissions ^ permission
        self.world.play_log.info('%s revoked %s\'s %s authority.' % (
                    self.pc.fancy_name(), player.fancy_name(), perm.upper()))
        self.pc.update_output('%s has had the privilige of %s revoked.' % (player.fancy_name(), perm))
        player.update_output('%s has revoked your %s priviliges.' % (self.pc.fancy_name(), perm))
        if not player.is_npc():
            player.save()
            if player.get_mode() == 'BuildMode':
                player.set_mode('normal')
                player.update_output('You have been kicked from BuildMode.')
dataset/ETHPy150Open shinymud/ShinyMUD/src/shinymud/commands/commands.py/Revoke.execute/original