[FIX] 'Not Allowed' in message auditing (#19762)

pull/19807/head
Martin Schoeler 5 years ago committed by GitHub
parent e53b5784fe
commit 4e72f02a6b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      ee/app/auditing/server/methods.js

@ -6,7 +6,7 @@ import { TAPi18n } from 'meteor/rocketchat:tap-i18n';
import AuditLog from './auditLog';
import { LivechatRooms, Rooms, Messages, Users } from '../../../../app/models/server';
import { hasAllPermission } from '../../../../app/authorization/server';
import { hasPermission } from '../../../../app/authorization/server';
const getValue = (room) => room && { rids: [room._id], name: room.name };
@ -37,7 +37,7 @@ Meteor.methods({
check(endDate, Date);
const user = Meteor.user();
if (!hasAllPermission(user._id, 'can-audit')) {
if (!hasPermission(user._id, 'can-audit')) {
throw new Meteor.Error('Not allowed');
}
@ -71,7 +71,7 @@ Meteor.methods({
check(endDate, Date);
const user = Meteor.user();
if (!hasAllPermission(user._id, 'can-audit')) {
if (!hasPermission(user._id, 'can-audit')) {
throw new Meteor.Error('Not allowed');
}
@ -115,7 +115,7 @@ Meteor.methods({
auditGetAuditions({ startDate, endDate }) {
check(startDate, Date);
check(endDate, Date);
if (!hasAllPermission(Meteor.userId(), 'can-audit-log')) {
if (!hasPermission(Meteor.userId(), 'can-audit-log')) {
throw new Meteor.Error('Not allowed');
}
return AuditLog.find({

Loading…
Cancel
Save