FIX: If personal messages are disabled, don't show messages for groups

This commit is contained in:
Robin Ward 2018-02-02 16:35:32 -05:00
parent e262939590
commit 2f19588311
2 changed files with 6 additions and 1 deletions

View File

@ -6,6 +6,9 @@ export default Ember.Controller.extend({
@computed('model.is_group_user')
showGroupMessages(isGroupUser) {
if (!this.siteSettings.enable_personal_messages) {
return false;
}
return isGroupUser || (this.currentUser && this.currentUser.admin);
}
});

View File

@ -13,6 +13,8 @@ module GroupGuardian
end
def can_see_group_messages?(group)
SiteSetting.enable_private_messages? && (
is_admin? || group.users.include?(user)
)
end
end