The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/ee/app/models/server/raw/LivechatDepartment.js

17 lines
876 B

import { LivechatDepartmentRaw } from '../../../../../app/models/server/raw/LivechatDepartment';
import { logger } from '../../../livechat-enterprise/server/lib/logger';
import { addQueryRestrictionsToDepartmentsModel } from '../../../livechat-enterprise/server/lib/query.helper';
import { overwriteClassOnLicense } from '../../../license/server';
const applyRestrictions = (method) => function(originalFn, originalQuery, ...args) {
const query = addQueryRestrictionsToDepartmentsModel(originalQuery);
logger.queries.debug(() => `LivechatDepartmentRaw.${ method } - ${ JSON.stringify(query) }`);
return originalFn.call(this, query, ...args);
};
overwriteClassOnLicense('livechat-enterprise', LivechatDepartmentRaw, {
find: applyRestrictions('find'),
findOne: applyRestrictions('findOne'),
update: applyRestrictions('update'),
remove: applyRestrictions('remove'),
});