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/app/models/server/raw/Subscriptions.js

26 lines
432 B

import { BaseRaw } from './BaseRaw';
export class SubscriptionsRaw extends BaseRaw {
findOneByRoomIdAndUserId(rid, uid, options) {
const query = {
rid,
'u._id': uid,
};
return this.col.findOne(query, options);
}
isUserInRole(uid, roleName, rid) {
if (rid == null) {
return;
}
const query = {
'u._id': uid,
rid,
roles: roleName,
};
return this.findOne(query, { fields: { roles: 1 } });
}
}