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/authorization/server/streamer/permissions/index.ts

28 lines
693 B

import { Meteor } from 'meteor/meteor';
import { check, Match } from 'meteor/check';
import { Permissions } from '../../../../models/server/raw';
Meteor.methods({
async 'permissions/get'(updatedAt: Date) {
check(updatedAt, Match.Maybe(Date));
// TODO: should we return this for non logged users?
// TODO: we could cache this collection
const records = await Permissions.find(updatedAt && { _updatedAt: { $gt: updatedAt } }).toArray();
if (updatedAt instanceof Date) {
return {
update: records,
remove: await Permissions.trashFindDeletedAfter(
updatedAt,
{},
{ fields: { _id: 1, _deletedAt: 1 } },
).toArray(),
};
}
return records;
},
});