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 delete-own-message permission #15512

Merged
merged 6 commits into from
Oct 28, 2019
Merged

Conversation

ggazzo
Copy link
Member

@ggazzo ggazzo commented Oct 4, 2019

Closes #5434

rodrigok
rodrigok previously approved these changes Oct 9, 2019
@rodrigok
Copy link
Member

rodrigok commented Oct 9, 2019

@ggazzo need to improve the title!

@ggazzo
Copy link
Member Author

ggazzo commented Oct 10, 2019

@rodrigok thinking more about, I dont think this pr is good enough, I'm using return true, false AND an exception, and I'm not sure if we should use this behavior with a function canSomething...

@ggazzo ggazzo added this to the 2.3.0 milestone Oct 21, 2019
@cchbr
Copy link

cchbr commented Oct 23, 2019

Will this be included in a release any time soon? It is greatly needed in my instance of Rocket chat.

@reetp
Copy link

reetp commented Oct 23, 2019

Will this be included in a release any time soon? It is greatly needed in my instance of Rocket chat.

It's Open Source. So it will be included when it is ready... If you look it is in the 2.3.0 milestone. But that may slip depending on the developers priorities - what is important to you may not be so important to them....

Of course you can pay for support. Or your pull request with a fix will be welcomed.

If not I'm afraid you will just have to be patient.

@ggazzo
Copy link
Member Author

ggazzo commented Oct 25, 2019

@cchbr sure, we are planning to deliver in to the next release (2.3.0 or 3.0.0, November 27th), if you are running your own build, you can make a cherry pick :)

Copy link
Contributor

@tassoevan tassoevan left a comment

Choose a reason for hiding this comment

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

Minor corrections in code style. Everything else looks fine.

app/authorization/server/functions/canDeleteMessage.js Outdated Show resolved Hide resolved
app/authorization/server/functions/canDeleteMessage.js Outdated Show resolved Hide resolved
app/authorization/server/functions/canDeleteMessage.js Outdated Show resolved Hide resolved
Co-Authored-By: Tasso Evangelista <tasso.evangelista@rocket.chat>
@lgtm-com
Copy link

lgtm-com bot commented Oct 28, 2019

This pull request introduces 1 alert when merging 436fad9 into 6c0e8d1 - view on LGTM.com

new alerts:

  • 1 for Unused variable, import, function or class

app/utils/client/lib/canDeleteMessage.js Show resolved Hide resolved
@@ -30,6 +30,7 @@ export function messageContext({ rid } = Template.instance()) {
showreply: true,
showReplyButton: true,
hasPermissionDeleteMessage: hasPermission('delete-message', rid),
hasPermissionDeleteOwnMessage: hasPermission('delete-own-message'),
Copy link
Member

Choose a reason for hiding this comment

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

is this being used somewhere?

Copy link
Member Author

Choose a reason for hiding this comment

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

not yet, but hasPermissionDeleteMessage is not being used too, I just passing the context, and maybe after I could improve some stuffs.

@ggazzo ggazzo merged commit 04b4b9a into develop Oct 28, 2019
@ggazzo ggazzo deleted the feat/delete-own-message branch October 28, 2019 20:20
@sampaiodiego sampaiodiego mentioned this pull request Nov 28, 2019
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.

Can delete own messages even without the delete message permission
6 participants