• 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

18.18
/api/controllers/v1/document-duplicate/create-many.js
1
const RightService = require('../../../services/RightService');
1✔
2

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

14
  const dateInscription = req.param('dateInscription', new Date());
×
15

16
  const duplicateParams = req.body.data.map((content) => ({
×
17
    dateInscription,
18
    content,
19
    document: content.document,
20
  }));
21

22
  await TDocumentDuplicate.createEach(duplicateParams);
×
23
  return res.ok();
×
24
};
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