-
Notifications
You must be signed in to change notification settings - Fork 1
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
Document how to add privileged users #31
Comments
As in, trying to configure privileged users in the bot's code, in chat, or through the command line when the bot is not running? |
This is in relation to Andy's request last week. I remember we discussed this back when I originally wanted to add myself to PulseMonitor, but I can't remember what I did then. https://chat.stackoverflow.com/transcript/message/46852336#46852336 I'm working on a simple command-line hack to create the necessary configuration file. If there is a way to pivot from unprivileged to privileged via chat, what would that be, and how would that work? |
https://github.com/SOBotics/Botpy/blob/master/docs/privilege_system.rst has an incomplete fragment:
I guess this should be fixed as well, or instead. |
I tried to do this correctly by using the methods in the package, but i ended up having to mock out large parts of ChatExchange, so I gave up on that, and instead landed on the following quick and dirty solution:
This is probably not robust enough to put into the source tree as a utility for future use, though. Ideally I suppose the code should be refactored to allow you to exercise the methods from The above hardcodes privilege level 1 as Incidentally, I can't find where the There are several files which have an |
I think the use case of the file has been quite misunderstood. The file Now, user privileges were designed to be edited through chat; but, to do that, some user needs to have privileges first. Since the RO's often have maximum privileges, you can use this method to grant them the max privs. Once that method has been used, the file will automatically be created, and then once a new user has been granted privileges through chat, the file will be updated by the bot itself. The only drawback I see in this is that if the owner of the bot is not an RO in the room they are running in, they'll probably have to wait for an RO to grant them privileges (and this also assumes that ROs must be given maximum privileges). I think a new method to specifically grant privileges to a user in a room should be enough. Once that's done, that user should be able to do everything else. I don't see the need for a command line utility, or have I not understood the issue properly? |
(About hardcoding "owner" as 1: the privilege system was designed to be flexible, so you could probably keep an infinite number of privilege levels; the docs just show a specific example) |
The use case am attempting to support is running a bot in a room where you are not the owner, and might not have the explicit cooperation of the room owner (not because they disallow bots, but because they have other things to do than help you run a bot, and possibly not the patience to understand a simple request even if you phrase it carefully. Maybe they dislike but tolerate bots, or whatever). I am vaguely confused by the code -- the file I have in PulseMonitor's configuration is very definitely a (Or am I confused because PulseMonitor does something differently?) |
Yes, that is a use case which I perfectly agree with, as I had mentioned in my previous comment. However, I don't see the use of creating a command-line tool to do this. Right now, a line of code can add all room owner to the privilege list; maybe another method to add a specific user to the privilege list should do the trick? Or do you still feel that a full-fledged command-line tool to manipulate the privilege list is necessary? As far as I see in the code, only a json is written; that json is an encoded pickle, using jsonpickle, but the actual file is surely a json. What's the name of the file you're looking at? |
There does not appear to be a convenient way to configure privileged users.
So far, what I have done is to manually manipulate the room's pickle file, but this is clearly less than ideal. If there is no better way to do it currently, at the very least it should be documented (but it's probably less effort to implement a simple command-line tool).
The text was updated successfully, but these errors were encountered: