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

GrottoCenter / grottocenter-api / 16322644865

16 Jul 2025 02:37PM UTC coverage: 42.462% (-0.2%) from 42.622%
16322644865

push

github

YohannSchatt
feat(api): add routes to get users, contributors, authors

729 of 2442 branches covered (29.85%)

Branch coverage included in aggregate %.

10 of 34 new or added lines in 4 files covered. (29.41%)

2496 of 5153 relevant lines covered (48.44%)

4.09 hits per line

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

17.65
/api/controllers/v1/caver/get-authors.js
1
const ControllerService = require('../../../services/ControllerService');
1✔
2
const RightService = require('../../../services/RightService');
1✔
3

4
module.exports = async (req, res) => {
1✔
NEW
5
  const hasAdmin = RightService.hasGroup(
×
6
    req.token.groups,
7
    RightService.G.ADMINISTRATOR
8
  );
9

NEW
10
  const hasModerator = RightService.hasGroup(
×
11
    req.token.groups,
12
    RightService.G.MODERATOR
13
  );
14

NEW
15
  if (!hasAdmin && !hasModerator) {
×
NEW
16
    return res.forbidden('You are not authorized to add a caver to a group.');
×
17
  }
18

NEW
19
  const cavers = await sails.models.vcaverroles.find({ isAuthor: true });
×
20

NEW
21
  if (!cavers) {
×
NEW
22
    return res.notFound({ message: 'No authors found.' });
×
23
  }
24

NEW
25
  return ControllerService.treat(
×
26
    req,
27
    null,
28
    cavers,
29
    { controllerMethod: 'CaverController.getAuthors' },
30
    res
31
  );
32
};
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

© 2025 Coveralls, Inc