From 3c4920d234163815aac844b28eec09ef3e2f05c1 Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Thu, 29 Dec 2016 11:52:07 +0800 Subject: [PATCH] FIX: Group admin tabs showing for non logged in users. --- app/assets/javascripts/discourse/controllers/group.js.es6 | 2 ++ test/javascripts/acceptance/groups-test.js.es6 | 5 ++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/discourse/controllers/group.js.es6 b/app/assets/javascripts/discourse/controllers/group.js.es6 index 4a8a87c0851..59bfb78fd44 100644 --- a/app/assets/javascripts/discourse/controllers/group.js.es6 +++ b/app/assets/javascripts/discourse/controllers/group.js.es6 @@ -66,6 +66,8 @@ export default Ember.Controller.extend({ } else { display = admin || isGroupOwner; } + } else if (t.get('requiresGroupAdmin')) { + display = false; } return display; diff --git a/test/javascripts/acceptance/groups-test.js.es6 b/test/javascripts/acceptance/groups-test.js.es6 index 74422b10658..aaa1411cacd 100644 --- a/test/javascripts/acceptance/groups-test.js.es6 +++ b/test/javascripts/acceptance/groups-test.js.es6 @@ -48,9 +48,8 @@ test("Viewing Group", () => { 0, 'it should not show messages tab if user is not a group user or admin' ); - - ok(find(".nav-stacked li a[title='Edit Group']").length === 0, 'it should not show messages tab if user is not admin'); - ok(find(".nav-stacked li a[title='Logs']").length === 0, 'it should not show Logs tab if user is not admin'); + ok(find(".nav-pills li a[title='Edit Group']").length === 0, 'it should not show messages tab if user is not admin'); + ok(find(".nav-pills li a[title='Logs']").length === 0, 'it should not show Logs tab if user is not admin'); ok(count('.user-stream .item') > 0, "it lists stream items"); }); });