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

[NEW] Add leave public channel & leave private channel permissions #9584

Merged
merged 8 commits into from
Mar 26, 2018

Conversation

kb0304
Copy link
Contributor

@kb0304 kb0304 commented Feb 2, 2018

@RocketChat/core

This PR adds a permission "leave-c" which if not present, prevents a user from leaving a public channel.
By default: Everyone is allowed, except guests.

Closes #7268

@@ -34,6 +34,7 @@ Meteor.startup(function() {
{ _id: 'edit-room', roles : ['admin', 'owner', 'moderator'] },
{ _id: 'force-delete-message', roles : ['admin', 'owner'] },
{ _id: 'join-without-join-code', roles : ['admin', 'bot'] },
{ _id: 'leave-c', roles : ['admin', 'user', 'bot', 'anonymous'] },
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My only concern with doing this is for servers which have custom roles setup. I almost think we need to have a migration to ensure this gets added to all roles on the server except for guest. This way server administrators are forced to disable a person's ability to leave a channel manually instead of a new "odd behavior" happening.

Also, do you think we should create this for private groups as well? 🤔

@kb0304
Copy link
Contributor Author

kb0304 commented Feb 3, 2018

Hi Bradley (@graywolf336 ),

I have tried to write a migration for the same.
I am getting "Not migrating, control is locked" in the first attempt, but in the second attempt it says "already applied". And the migrations are actually applied. I am unable to find its cause, can you please guide me how to proceed.

Also, I think we should create the same for private channels as well. Should I proceed with that? If yes, in a separate PR or this one only?

Thanks

@graywolf336
Copy link
Contributor

I will look into that, although if memory serves me correct then that is the expected behavior of the migrations.

Go ahead and add it for private channels as well, but keep it in this same pull request. :)

@kb0304 kb0304 changed the title [NEW]: Add leave public channel permission [NEW]: Add leave public channel & leave private channel permission Feb 8, 2018
@kb0304
Copy link
Contributor Author

kb0304 commented Feb 8, 2018

@graywolf336
I have done it for private channels as well. Kindly review.

@engelgabriel engelgabriel temporarily deployed to rocket-chat-pr-9584 February 15, 2018 14:48 Inactive
@geekgonecrazy
Copy link
Contributor

When testing migrations you'll have to edit the DB and set to previous migration version so your migration will rerun. Kind of tedius. But that's the only way to run it again

@kb0304
Copy link
Contributor Author

kb0304 commented Feb 19, 2018

@geekgonecrazy
I am concerned about "Not migrating, control is locked", is this usual?

screenshot from 2018-02-19 21-03-32

@geekgonecrazy
Copy link
Contributor

It should be. As long as your migration returns and stuff like its supposed to it should be fine. That's why we update the version and lock it to prevent a migration from running twice

@engelgabriel engelgabriel temporarily deployed to rocket-chat-pr-9584 March 9, 2018 21:00 Inactive
@engelgabriel engelgabriel temporarily deployed to rocket-chat-pr-9584 March 26, 2018 15:03 Inactive
@rodrigok rodrigok changed the title [NEW]: Add leave public channel & leave private channel permission [NEW] Add leave public channel & leave private channel permissions Mar 26, 2018
@rodrigok rodrigok added this to the 0.63.0 milestone Mar 26, 2018
@rodrigok rodrigok merged commit 46366fa into RocketChat:develop Mar 26, 2018
@kb0304 kb0304 deleted the bugfix-7268 branch April 3, 2018 11:13
@rodrigok rodrigok mentioned this pull request Apr 4, 2018
@GoetheG
Copy link

GoetheG commented Apr 30, 2019

Hey there. Are there any news regarding this topic?

For our company it is vital to force employees staying in some channels. With that we want to ensure that our employees receive important information.

Looking forward to hearing from you guys.

@GoetheG
Copy link

GoetheG commented Feb 8, 2020

This should be merged with #7268

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

Successfully merging this pull request may close these issues.

Add permission -> "permission for leaving a channel"
6 participants