• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

GrottoCenter / grottocenter-api / 5631056675

pending completion
5631056675

push

github

vmarseguerra
refactor(right): replaces rights with a static groups system

751 of 1944 branches covered (38.63%)

Branch coverage included in aggregate %.

59 of 59 new or added lines in 35 files covered. (100.0%)

2702 of 5007 relevant lines covered (53.96%)

14.64 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

16.67
/api/controllers/v1/document-duplicate/delete-many.js
1
const ErrorService = require('../../../services/ErrorService');
1✔
2
const RightService = require('../../../services/RightService');
1✔
3

4
module.exports = async (req, res) => {
1✔
5
  const hasRight = RightService.hasGroup(
×
6
    req.token.groups,
7
    RightService.G.MODERATOR
8
  );
9
  if (!hasRight) {
×
10
    return res.forbidden(
×
11
      'You are not authorized to create a document duplicate.'
12
    );
13
  }
14

15
  const idArray = req.param('id');
×
16
  if (!idArray) {
×
17
    return res.badRequest('You must provide the id of the duplicates.');
×
18
  }
19

20
  try {
×
21
    await TDocumentDuplicate.destroy({
×
22
      id: idArray,
23
    });
24
    return res.ok();
×
25
  } catch (err) {
26
    ErrorService.getDefaultErrorHandler(res)(err);
×
27
    return false;
×
28
  }
29
};
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc