Redirect to group members tab if user cannot see messages tab.

This commit is contained in:
Guo Xiang Tan 2018-03-16 16:30:08 +08:00
parent aa91bd61a7
commit 19d6b9cb36
1 changed files with 10 additions and 0 deletions

View File

@ -2,4 +2,14 @@ export default Discourse.Route.extend({
titleToken() {
return I18n.t('groups.messages');
},
model() {
return this.modelFor('group');
},
afterModel(group) {
if (!group.get('is_group_user') || !(this.currentUser && this.currentUser.admin)) {
this.transitionTo("group.members", group);
}
},
});