mirror of
https://github.com/discourse/discourse.git
synced 2024-11-26 05:03:39 +08:00
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')
|
||||
showGroupMessages(isGroupUser) {
|
||||
if (!this.siteSettings.enable_personal_messages) {
|
||||
return false;
|
||||
}
|
||||
return isGroupUser || (this.currentUser && this.currentUser.admin);
|
||||
}
|
||||
});
|
||||
|
|
|
@ -13,6 +13,8 @@ module GroupGuardian
|
|||
end
|
||||
|
||||
def can_see_group_messages?(group)
|
||||
is_admin? || group.users.include?(user)
|
||||
SiteSetting.enable_private_messages? && (
|
||||
is_admin? || group.users.include?(user)
|
||||
)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue
Block a user