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

Don't require user exist in a public room to add other users #5683

Closed
timkinnane opened this issue Jan 20, 2017 · 8 comments
Closed

Don't require user exist in a public room to add other users #5683

timkinnane opened this issue Jan 20, 2017 · 8 comments

Comments

@timkinnane
Copy link
Contributor

0.49.3

Question for core team, mostly @marceloschmidt - Is there a strong reason for requiring that a user calling addUserToRoom must be a member of the room.

I have two uses cases I'm writing, 1st: automated workflows were a bot will drop people in a room at the end of an interaction. 2nd: provisioning scripts for new instances that will create rooms and add users according to a pre-defined config.

In both scenarios, I need the bot (1) and system admin (2) users to exist in the room first to add the new users - but they don't need to be there for any other reason and I don't really want users to see them in the room.

It makes sense for private rooms, but is there any good reason why I can't just remove that check for public rooms - there will still be the add-user-to-room permission check. I'm happy to make the PR if there's no objection to the concept.

See relevant line.

@timkinnane
Copy link
Contributor Author

Actually, in the case where the user calling the method is an admin, would it be bad to allow adding users to private rooms too (where the admin is not a member)? I think I need that for the provisioning scenario. I can just do that on my fork without a PR though if it's not desired in core.

@graywolf336
Copy link
Contributor

I would say that a new permission add-user-to-room-always or something of that sort would be a good addition and then use that to check, as I agree with you it would be nice to have for admins and privileged users like staff.

@maxdwit
Copy link

maxdwit commented Jan 24, 2017

Is this in 0.50.0 ? In my case I would like to add users to channels/private rooms without being in the channel.

@graywolf336
Copy link
Contributor

@maxdwit No it isn't, I will see about getting it into the next release though.

@timkinnane
Copy link
Contributor Author

@graywolf336 I was about to do this now, if you haven't yet? I'm going with your suggestion of adding a new permission, but for semantic accuracy I was thinking to change the original permission to be add-user-to-own-room and the new one add-user-to-any-room?

@graywolf336
Copy link
Contributor

@timkinnane go for it. That sounds good to me, be sure to create a migration to rename the existing one if it's required. 👍

@timkinnane
Copy link
Contributor Author

Yep, got it. ;)

engelgabriel added a commit that referenced this issue Feb 3, 2017
…mission-change

Fix #5683, add add-user-to-any-room permission
@engelgabriel engelgabriel modified the milestones: 0.51.0, Short-term Feb 3, 2017
@maxdwit
Copy link

maxdwit commented Jun 15, 2017

Test in 0.51. via API,
as Administrator - departed the "Test" Channel.
Added User to Channel via API.
Verified User is in this Channel.
Works as expected. Thanks

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

No branches or pull requests

5 participants