3 var troupeService = require('gitter-web-rooms/lib/troupe-service');
4 var policyFactory = require('gitter-web-permissions/lib/policy-factory');
5 var RoomWithPolicyService = require('gitter-web-rooms/lib/room-with-policy-service');
7 module.exports = function(req, res, next) {
8 var uri = '' + req.body.uri;
16 .then(function(troupe) {
18 return policyFactory.createPolicyForRoom(user, troupe);
20 .then(function(policy) {
21 var roomWithPolicyService = new RoomWithPolicyService(this.troupe, req.user, policy);
22 return roomWithPolicyService.sendBadgePullRequest();
25 res.send({ success: true });