FIX: If personal messages are disabled, don't show messages for groups
This commit is contained in:
parent
e262939590
commit
2f19588311
|
@ -6,6 +6,9 @@ export default Ember.Controller.extend({
|
||||||
|
|
||||||
@computed('model.is_group_user')
|
@computed('model.is_group_user')
|
||||||
showGroupMessages(isGroupUser) {
|
showGroupMessages(isGroupUser) {
|
||||||
|
if (!this.siteSettings.enable_personal_messages) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
return isGroupUser || (this.currentUser && this.currentUser.admin);
|
return isGroupUser || (this.currentUser && this.currentUser.admin);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -13,6 +13,8 @@ module GroupGuardian
|
||||||
end
|
end
|
||||||
|
|
||||||
def can_see_group_messages?(group)
|
def can_see_group_messages?(group)
|
||||||
|
SiteSetting.enable_private_messages? && (
|
||||||
is_admin? || group.users.include?(user)
|
is_admin? || group.users.include?(user)
|
||||||
|
)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue