FIX: do not display add/remove participants if you can’t actually do it (#7125)

FIX: do not display add/remove participants if you can’t actually do it (#7125)

diff --git a/app/assets/javascripts/discourse/widgets/private-message-map.js.es6 b/app/assets/javascripts/discourse/widgets/private-message-map.js.es6
index 40b5ce3..1ce3119 100644
--- a/app/assets/javascripts/discourse/widgets/private-message-map.js.es6
+++ b/app/assets/javascripts/discourse/widgets/private-message-map.js.es6
@@ -152,14 +152,17 @@ export default createWidget("private-message-map", {
     }
 
     const result = [h(`div.participants${hideNamesClass}`, participants)];
+    const controls = [];
 
-    const controls = [
-      this.attach("button", {
-        action: "toggleEditing",
-        label: "private_message_info.edit",
-        className: "btn btn-default add-remove-participant-btn"
-      })
-    ];
+    if (attrs.canRemoveAllowedUsers || attrs.canRemoveSelfId) {
+      controls.push(
+        this.attach("button", {
+          action: "toggleEditing",
+          label: "private_message_info.edit",
+          className: "btn btn-default add-remove-participant-btn"
+        })
+      );
+    }
 
     if (attrs.canInvite && this.state.isEditing) {
       controls.push(
@@ -171,7 +174,9 @@ export default createWidget("private-message-map", {
       );
     }
 
-    result.push(h("div.controls", controls));
+    if (controls.length) {
+      result.push(h("div.controls", controls));
+    }
 
     return result;
   },
diff --git a/app/assets/stylesheets/common/base/topic-post.scss b/app/assets/stylesheets/common/base/topic-post.scss
index 91463df..09247ad 100644
--- a/app/assets/stylesheets/common/base/topic-post.scss
+++ b/app/assets/stylesheets/common/base/topic-post.scss
@@ -357,7 +357,10 @@ aside.quote {
     display: flex;
     flex-wrap: wrap;
     align-items: center;
-    margin-bottom: 0.5em;
+
+    & + .controls {
+      margin-top: 0.5em;
+    }
 
     &.hide-names .user {
       .username,

GitHub sha: c90267db