summaryrefslogtreecommitdiffstats
path: root/webapp/components/edit_post_modal.jsx
diff options
context:
space:
mode:
authorAmit Yadav <iit.amit@gmail.com>2017-01-18 18:38:31 +0530
committerJoram Wilander <jwawilander@gmail.com>2017-01-18 08:08:31 -0500
commit99cf08ac38bdee25d07f27a3d9bb5d74199d106c (patch)
treee85ca087c2ec1b6bfe859d509b0f9e5c1a991630 /webapp/components/edit_post_modal.jsx
parent8f0175e15c4d6bd08ca6795851455468811c3dc9 (diff)
downloadchat-99cf08ac38bdee25d07f27a3d9bb5d74199d106c.tar.gz
chat-99cf08ac38bdee25d07f27a3d9bb5d74199d106c.tar.bz2
chat-99cf08ac38bdee25d07f27a3d9bb5d74199d106c.zip
Message Editing and Deleting permissions (#4692)
Diffstat (limited to 'webapp/components/edit_post_modal.jsx')
-rw-r--r--webapp/components/edit_post_modal.jsx11
1 files changed, 11 insertions, 0 deletions
diff --git a/webapp/components/edit_post_modal.jsx b/webapp/components/edit_post_modal.jsx
index 55bf5fe60..7c1747ef7 100644
--- a/webapp/components/edit_post_modal.jsx
+++ b/webapp/components/edit_post_modal.jsx
@@ -118,6 +118,17 @@ export default class EditPostModal extends React.Component {
}
handleEditPostEvent(options) {
+ var post = PostStore.getPost(options.channelId, options.postId);
+ if (global.window.mm_license.IsLicensed === 'true') {
+ if (global.window.mm_config.AllowEditPost === Constants.ALLOW_EDIT_POST_NEVER) {
+ return;
+ }
+ if (global.window.mm_config.AllowEditPost === Constants.ALLOW_EDIT_POST_TIME_LIMIT) {
+ if ((post.create_at + (global.window.mm_config.PostEditTimeLimit * 1000)) < Utils.getTimestamp()) {
+ return;
+ }
+ }
+ }
this.setState({
editText: options.message || '',
originalText: options.message || '',