|
|
|
|
@ -29,7 +29,7 @@ const common = { |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
const roomType = room && room.t; |
|
|
|
|
return roomType && roomTypes.roomTypes[roomType].canBeDeleted(hasPermission, room); |
|
|
|
|
return roomType && roomTypes.getConfig(roomType).canBeDeleted(hasPermission, room); |
|
|
|
|
}, |
|
|
|
|
canEditRoom() { |
|
|
|
|
const { _id } = Template.instance().room; |
|
|
|
|
@ -223,7 +223,7 @@ Template.channelSettingsEditing.onCreated(function() { |
|
|
|
|
type: 'text', |
|
|
|
|
label: 'Name', |
|
|
|
|
canView() { |
|
|
|
|
return roomTypes.roomTypes[room.t].allowRoomSettingChange(room, RoomSettingsEnum.NAME); |
|
|
|
|
return roomTypes.getConfig(room.t).allowRoomSettingChange(room, RoomSettingsEnum.NAME); |
|
|
|
|
}, |
|
|
|
|
canEdit() { |
|
|
|
|
return hasAllPermission('edit-room', room._id); |
|
|
|
|
@ -270,7 +270,7 @@ Template.channelSettingsEditing.onCreated(function() { |
|
|
|
|
type: 'markdown', |
|
|
|
|
label: 'Topic', |
|
|
|
|
canView() { |
|
|
|
|
return roomTypes.roomTypes[room.t].allowRoomSettingChange(room, RoomSettingsEnum.TOPIC); |
|
|
|
|
return roomTypes.getConfig(room.t).allowRoomSettingChange(room, RoomSettingsEnum.TOPIC); |
|
|
|
|
}, |
|
|
|
|
canEdit() { |
|
|
|
|
return hasAllPermission('edit-room', room._id); |
|
|
|
|
@ -289,7 +289,7 @@ Template.channelSettingsEditing.onCreated(function() { |
|
|
|
|
return Template.instance().room.announcement; |
|
|
|
|
}, |
|
|
|
|
canView() { |
|
|
|
|
return roomTypes.roomTypes[room.t].allowRoomSettingChange(room, RoomSettingsEnum.ANNOUNCEMENT); |
|
|
|
|
return roomTypes.getConfig(room.t).allowRoomSettingChange(room, RoomSettingsEnum.ANNOUNCEMENT); |
|
|
|
|
}, |
|
|
|
|
canEdit() { |
|
|
|
|
return hasAllPermission('edit-room', room._id); |
|
|
|
|
@ -305,7 +305,7 @@ Template.channelSettingsEditing.onCreated(function() { |
|
|
|
|
type: 'text', |
|
|
|
|
label: 'Description', |
|
|
|
|
canView() { |
|
|
|
|
return roomTypes.roomTypes[room.t].allowRoomSettingChange(room, RoomSettingsEnum.DESCRIPTION); |
|
|
|
|
return roomTypes.getConfig(room.t).allowRoomSettingChange(room, RoomSettingsEnum.DESCRIPTION); |
|
|
|
|
}, |
|
|
|
|
canEdit() { |
|
|
|
|
return hasAllPermission('edit-room', room._id); |
|
|
|
|
@ -386,7 +386,7 @@ Template.channelSettingsEditing.onCreated(function() { |
|
|
|
|
isToggle: true, |
|
|
|
|
processing: new ReactiveVar(false), |
|
|
|
|
canView() { |
|
|
|
|
return roomTypes.roomTypes[room.t].allowRoomSettingChange(room, RoomSettingsEnum.READ_ONLY); |
|
|
|
|
return roomTypes.getConfig(room.t).allowRoomSettingChange(room, RoomSettingsEnum.READ_ONLY); |
|
|
|
|
}, |
|
|
|
|
canEdit() { |
|
|
|
|
return !room.broadcast && hasAllPermission('set-readonly', room._id); |
|
|
|
|
@ -401,7 +401,7 @@ Template.channelSettingsEditing.onCreated(function() { |
|
|
|
|
isToggle: true, |
|
|
|
|
processing: new ReactiveVar(false), |
|
|
|
|
canView() { |
|
|
|
|
return roomTypes.roomTypes[room.t].allowRoomSettingChange(room, RoomSettingsEnum.REACT_WHEN_READ_ONLY); |
|
|
|
|
return roomTypes.getConfig(room.t).allowRoomSettingChange(room, RoomSettingsEnum.REACT_WHEN_READ_ONLY); |
|
|
|
|
}, |
|
|
|
|
canEdit() { |
|
|
|
|
return !room.broadcast && hasAllPermission('set-react-when-readonly', room._id); |
|
|
|
|
@ -418,7 +418,7 @@ Template.channelSettingsEditing.onCreated(function() { |
|
|
|
|
isToggle: true, |
|
|
|
|
processing: new ReactiveVar(false), |
|
|
|
|
canView() { |
|
|
|
|
return roomTypes.roomTypes[room.t].allowRoomSettingChange( |
|
|
|
|
return roomTypes.getConfig(room.t).allowRoomSettingChange( |
|
|
|
|
room, |
|
|
|
|
RoomSettingsEnum.SYSTEM_MESSAGES, |
|
|
|
|
); |
|
|
|
|
@ -460,7 +460,7 @@ Template.channelSettingsEditing.onCreated(function() { |
|
|
|
|
isToggle: true, |
|
|
|
|
processing: new ReactiveVar(false), |
|
|
|
|
canView() { |
|
|
|
|
return roomTypes.roomTypes[room.t].allowRoomSettingChange(room, RoomSettingsEnum.ARCHIVE_OR_UNARCHIVE); |
|
|
|
|
return roomTypes.getConfig(room.t).allowRoomSettingChange(room, RoomSettingsEnum.ARCHIVE_OR_UNARCHIVE); |
|
|
|
|
}, |
|
|
|
|
canEdit() { |
|
|
|
|
return hasAtLeastOnePermission(['archive-room', 'unarchive-room'], room._id); |
|
|
|
|
@ -501,7 +501,7 @@ Template.channelSettingsEditing.onCreated(function() { |
|
|
|
|
isToggle: true, |
|
|
|
|
processing: new ReactiveVar(false), |
|
|
|
|
canView() { |
|
|
|
|
return roomTypes.roomTypes[room.t].allowRoomSettingChange(room, RoomSettingsEnum.BROADCAST); |
|
|
|
|
return roomTypes.getConfig(room.t).allowRoomSettingChange(room, RoomSettingsEnum.BROADCAST); |
|
|
|
|
}, |
|
|
|
|
canEdit() { |
|
|
|
|
return false; |
|
|
|
|
@ -516,7 +516,7 @@ Template.channelSettingsEditing.onCreated(function() { |
|
|
|
|
showingValue: new ReactiveVar(false), |
|
|
|
|
realValue: null, |
|
|
|
|
canView() { |
|
|
|
|
return roomTypes.roomTypes[room.t].allowRoomSettingChange(room, RoomSettingsEnum.JOIN_CODE) && hasAllPermission('edit-room', room._id); |
|
|
|
|
return roomTypes.getConfig(room.t).allowRoomSettingChange(room, RoomSettingsEnum.JOIN_CODE) && hasAllPermission('edit-room', room._id); |
|
|
|
|
}, |
|
|
|
|
canEdit() { |
|
|
|
|
return hasAllPermission('edit-room', room._id); |
|
|
|
|
@ -679,7 +679,7 @@ Template.channelSettingsEditing.onCreated(function() { |
|
|
|
|
isToggle: true, |
|
|
|
|
processing: new ReactiveVar(false), |
|
|
|
|
canView() { |
|
|
|
|
return roomTypes.roomTypes[room.t].allowRoomSettingChange(room, RoomSettingsEnum.E2E); |
|
|
|
|
return roomTypes.getConfig(room.t).allowRoomSettingChange(room, RoomSettingsEnum.E2E); |
|
|
|
|
}, |
|
|
|
|
canEdit() { |
|
|
|
|
return hasAllPermission('edit-room', room._id); |
|
|
|
|
|