Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add in option to limit crud operations on Factoids to voice/ops. #378

Closed
andrewtryder opened this issue Jul 22, 2012 · 2 comments
Closed

Comments

@andrewtryder
Copy link
Contributor

Hi,

I had some "abuse" of Factoids via people in a channel, mainly those not voiced or opped. nyuszika7h helped me add some code into plugins/Factoids/plugin.py like:

    if self.registryValue('requireVoice', channel):
        if not irc.state.channels[channel].isOp(msg.nick) and \
            not irc.state.channels[channel].isVoice(msg.nick): 
                irc.error('You must be at least voiced')
                return

(add around line 152 after (keyid, factid) = self._getKeyAndFactId(channel, key, factoid) )

with (from config.py):

conf.registerChannelValue(Factoids, 'requireVoice',
registry.Boolean(True, """Only allows a user with voice or above on a
channel to use the command."""))


I figure this could be added to each crud operation (learn, forget) and maybe also have a configuration to only allow ops in a channel?

I wanted to submit the idea for further consideration.

Thanks.

@progval
Copy link
Owner

progval commented Jul 22, 2012

What kind of abuse?

BTW, you forgot halfop handling.

Sent from my Android phone with K-9 Mail. Please excuse my brevity.

@andrewtryder
Copy link
Contributor Author

It's a small channel but adding in of a lot of spam into the database. I didn't mean abuse as being hacked or someone exploiting sql injection of some sort. Since the trusted people in the channel are either voice or op, I wanted to keep that enforced because the default setup allowed anyone in the channel to add.

I didn't add in half-op since I don't think efnet ircd supports it? I am unaware of if it's considered above or below voice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants