Example #1
0
        MongoClient.connect(uri, function(err, database) {
            var mongoBackend = new acl.mongodbBackend(database, 'acl_');
            aclinstance = new acl(mongoBackend);

            aclinstance.allow('admin', ['users', 'activities', 'categories', 'items'], '*');
            aclinstance.allow('customer', ['users', 'activities', 'categories', 'items'], 'get');
            aclinstance.allow('customer', ['consignees', 'markItems', 'orders', 'appointments', 'appointmentOrders'], '*');

            next && next(aclinstance);
        });
Example #2
0
exports.invokeRolesPolicies = function () {
  acl.allow([{
    roles: ['admin'],
    allows: [{
      resources: '/api/races',
      permissions: '*'
    }, {
      resources: '/api/races/:raceId',
      permissions: '*'
    }]
  }, {
    roles: ['consultant'],
    allows: [{
      resources: '/api/races',
      permissions: ['get', 'post']
    }, {
      resources: '/api/races/:raceId',
      permissions: ['get']
    }]
  }, {
    roles: ['user','guest'],
    allows: [{
      resources: '/api/races',
      permissions: ['get']
    }, {
      resources: '/api/races/:raceId',
      permissions: ['get']
    }]
  }]);
};
exports.invokeRolesPolicies = function () {
  acl.allow([{
    roles: ['admin'],
    allows: [{
      resources: '/api/deaths',
      permissions: '*'
    }, {
      resources: '/api/deaths/:deathId',
      permissions: '*'
    }]
  }, {
    roles: ['user'],
    allows: [{
      resources: '/api/deaths',
      permissions: ['get', 'post']
    }, {
      resources: '/api/deaths/:deathId',
      permissions: ['get']
    }]
  }, {
    roles: ['guest'],
    allows: [{
      resources: '/api/deaths',
      permissions: ['get']
    }, {
      resources: '/api/deaths/:deathId',
      permissions: ['get']
    }]
  }]);
};
exports.invokeRolesPolicies = function () {
  acl.allow([{
    roles: ['admin', 'manager'],
    allows: [{
      resources: '/api/transfers',
      permissions: '*'
    }, {
      resources: '/api/transfers/:transferId',
      permissions: '*'
    }]
  }, {
    roles: ['user'],
    allows: [{
      resources: '/api/transfers',
      permissions: ['get', 'post']
    }, {
      resources: '/api/transfers/:transferId',
      permissions: ['get']
    }]
  }, {
    roles: ['guest'],
    allows: [{
      resources: '/api/transfers',
      permissions: ['get']
    }, {
      resources: '/api/transfers/:transferId',
      permissions: ['get']
    }]
  }]);
};
exports.invokeRolesPolicies = function() {
  acl.allow([{
    roles: ['admin'],
    allows: [{
      resources: '/api/eventpeoplegroups',
      permissions: '*'
    }, {
      resources: '/api/eventpeoplegroups/:eventpeoplegroupId',
      permissions: '*'
    }]
  }, {
    roles: ['inscriptor'],
    allows: [{
      resources: '/api/eventpeoplegroups',
      permissions: ['get', 'post', 'patch', 'put']
    }, {
      resources: '/api/eventpeoplegroups/:eventpeoplegroupId',
      permissions: ['get', 'post', 'patch', 'put']
    }]
  }, {
    roles: ['guest', 'user'],
    allows: [{
      resources: '/api/eventpeoplegroups',
      permissions: ['get']
    }, {
      resources: '/api/eventpeoplegroups/:eventpeoplegroupId',
      permissions: ['get']
    }]
  }]);
};
exports.invokeRolesPolicies = function () {
  acl.allow([{
    roles: ['admin'],
    allows: [{
      resources: '/api/gardens',
      permissions: '*'
    }, {
      resources: '/api/gardens/:gardenId',
      permissions: '*'
    },
    {
      resources: '/api/gardens/:gardenId/approve',
      permissions: '*'
    }]
  },{
    roles: ['user'],
    allows: [{
      resources: '/api/gardens',
      permissions: '*'
    }, {
      resources: '/api/gardens/:gardenId',
      permissions: '*'
    }]
  }]);
};
exports.invokeRolesPolicies = function () {
  acl.allow([{
    roles: ['admin'],
    allows: [{
      resources: '/api/garbage-extents',
      permissions: '*'
    }, {
      resources: '/api/garbage-extents/:garbageExtentId',
      permissions: '*'
    }]
  }, {
    roles: ['user'],
    allows: [{
      resources: '/api/garbage-extents',
      permissions: ['get', 'post']
    }, {
      resources: '/api/garbage-extents/:garbageExtentId',
      permissions: ['get']
    }]
  }, {
    roles: ['guest'],
    allows: [{
      resources: '/api/garbage-extents',
      permissions: ['get']
    }, {
      resources: '/api/garbage-extents/:garbageExtentId',
      permissions: ['get']
    }]
  }]);
};
exports.invokeRolesPolicies = function () {
  acl.allow([{
    roles: ['admin'],
    allows: [{
      resources: '/api/mobile-organisms',
      permissions: ['*']
    }, {
      resources: '/api/mobile-organisms/:mobileOrganismId/upload-images',
      permissions: ['*']
    }, {
      resources: '/api/mobile-organisms/:mobileOrganismId',
      permissions: ['*']
    }]
  }, {
    roles: ['team lead', 'team member', 'user', 'guest'],
    allows: [{
      resources: '/api/mobile-organisms',
      permissions: '*'
    }, {
      resources: '/api/mobile-organisms/:mobileOrganismId/upload-images',
      permissions: '*'
    }, {
      resources: '/api/mobile-organisms/:mobileOrganismId',
      permissions: '*'
    }]
  }]);
};
 return new Promise(function(resolve, reject) {
   acl.allow([{
     roles: ['admin'],
     allows: [{
       resources: '/',
       permissions: '*'
     }, {
       resources: '/:blogId',
       permissions: '*'
     }]
   }, {
     roles: ['user'],
     allows: [{
       resources: '/',
       permissions: ['get', 'post']
     }, {
       resources: '/:blogId',
       permissions: ['get']
     }]
   }, {
     roles: ['guest'],
     allows: [{
       resources: '/',
       permissions: ['get']
     }, {
       resources: '/:blogId',
       permissions: ['get']
     }]
   }]);
   resolve();
 });
exports.invokeRolesPolicies = function () {
  acl.allow([{
    roles: ['admin'],
    allows: [{
      resources: '/api/requirements',
      permissions: '*'
    }, {
      resources: '/api/requirements/:requiremendId',
      permissions: '*'
    }]
  }, {
    roles: ['user'],
    allows: [{
      resources: '/api/requirements',
      permissions: ['*']
    }, {
      resources: '/api/requirements/:requiremendId',
      permissions: ['*']
    }]
  }, {
    roles: ['guest'],
    allows: [{
      resources: '/api/requirements',
      permissions: ['*']
    }, {
      resources: '/api/requirements/:requiremendId',
      permissions: ['*']
    }]
  }]);
};
exports.invokeRolesPolicies = function () {
  acl.allow([{
    roles: ['admin'],
    allows: [{
      resources: '/api/servicos',
      permissions: '*'
    }, {
      resources: '/api/servicos/:servicoId',
      permissions: '*'
    }]
  }, {
    roles: ['user','elaborador','aprovador'],
    allows: [{
      resources: '/api/servicos',
      permissions: ['get', 'post']
    }, {
      resources: '/api/servicos/:servicoId',
      permissions: ['get']
    }]
  }, {
    roles: ['guest'],
    allows: [{
      resources: '/api/servicos',
      permissions: ['get']
    }, {
      resources: '/api/servicos/:servicoId',
      permissions: ['get']
    }]
  }]);
};
exports.invokeRolesPolicies = function () {
  acl.allow([{
    roles: ['team member', 'team lead', 'admin'],
    allows: [{
      resources: '/api/protocol-oyster-measurements/:oysterMeasurementId/index/:substrateIndex/upload-outer-substrate',
      permissions: '*'
    }, {
      resources: '/api/protocol-oyster-measurements/:oysterMeasurementId/index/:substrateIndex/upload-inner-substrate',
      permissions: '*'
    }, {
      resources: '/api/protocol-oyster-measurements/:oysterMeasurementId/upload-oyster-cage-condition',
      permissions: '*'
    }, {
      resources: '/api/protocol-oyster-measurements/:oysterMeasurementId/incremental-save',
      permissions: '*'
    }, {
      resources: '/api/protocol-oyster-measurements/:currentOysterMeasurementId/previous',
      permissions: '*'
    }, {
      resources: '/api/protocol-oyster-measurements/:oysterMeasurementId',
      permissions: '*'
    }, {
      resources: '/api/protocol-oyster-measurements',
      permissions: '*'
    }]
  }, {
    roles: ['user', 'partner', 'guest'],
    allows: [{
      resources: '/api/protocol-oyster-measurements/:oysterMeasurementId',
      permissions: ['get']
    }]
  }]);
};
exports.invokeRolesPolicies = function () {
  acl.allow([{
    roles: ['admin'],
    allows: [{
      resources: '/api/applications',
      permissions: '*'
    }, {
      resources: '/api/applications/:applicationId',
      permissions: '*'
    }, {
      resources: '/api/applications/makeathon/:makeathonId',
      permissions: ['get']
    }]
  }, {
    roles: ['user'],
    allows: [{
      resources: '/api/applications',
      permissions: ['get', 'post']
    }, {
      resources: '/api/applications/:applicationId',
      permissions: ['get']
    }]
  }, {
    roles: ['guest'],
    allows: [{
      resources: '/api/applications',
      permissions: ['get']
    }, {
      resources: '/api/applications/:applicationId',
      permissions: ['get']
    }]
  }]);
};
exports.invokeRolesPolicies = function () {
  acl.allow([{
    roles: ['admin', 'cliente', 'fornecedor'],
    allows: [{
      resources: '/api/segmentos',
      permissions: '*'
    }, {
      resources: '/api/segmentos/:segmentoId',
      permissions: '*'
    }, {
      resources: '/api/segmentos/fornecedor/adicionar',
      permissions: '*'
    }]
  }, {
    roles: ['user'],
    allows: [{
      resources: '/api/segmentos',
      permissions: ['get', 'post']
    }, {
      resources: '/api/segmentos/:segmentoId',
      permissions: ['get']
    }]
  }, {
    roles: ['guest'],
    allows: [{
      resources: '/api/segmentos',
      permissions: ['get']
    }, {
      resources: '/api/segmentos/:segmentoId',
      permissions: ['get']
    }]
  }]);
};
exports.invokeRolesPolicies = function () {
  acl.allow([{
    roles: ['admin'],
    allows: [{
      resources: '/api/salinity-units',
      permissions: '*'
    }, {
      resources: '/api/salinity-units/:salinityUnitId',
      permissions: '*'
    }]
  }, {
    roles: ['user'],
    allows: [{
      resources: '/api/salinity-units',
      permissions: ['get', 'post']
    }, {
      resources: '/api/salinity-units/:salinityUnitId',
      permissions: ['get']
    }]
  }, {
    roles: ['guest'],
    allows: [{
      resources: '/api/salinity-units',
      permissions: ['get']
    }, {
      resources: '/api/salinity-units/:salinityUnitId',
      permissions: ['get']
    }]
  }]);
};
Example #16
0
exports.invokeRolesPolicies = function () {
  acl.allow([{
    roles: ['admin'],
    allows: [{
      resources: '/api/routes',
      permissions: '*'
    }, {
      resources: '/api/routes/:routeId',
      permissions: '*'
    }]
  },{
    roles: ['pratiriouxos'],
    allows: [{
      resources: '/api/routes',
      permissions: '*'
    }, {
      resources: '/api/routes/:routeId',
      permissions: '*'
    },{
      resources: '/api/croutes/company?companyname=',
      permissions: '*'
    }]
  }
  ]);
};
exports.invokeRolesPolicies = function () {
  acl.allow([{
    roles: ['admin'],
    allows: [{
      resources: '/api/tribes',
      permissions: ['get']
    }, {
      resources: '/api/tribes/:tribe',
      permissions: ['get']
    }]
  }, {
    roles: ['user'],
    allows: [{
      resources: '/api/tribes',
      permissions: ['get']
    }, {
      resources: '/api/tribes/:tribe',
      permissions: ['get']
    }]
  }, {
    roles: ['guest'],
    allows: [{
      resources: '/api/tribes',
      permissions: ['get']
    }, {
      resources: '/api/tribes/:tribe',
      permissions: ['get']
    }]
  }]);
};
Example #18
0
exports.invokeRolesPolicies = function() {
	acl.allow([{
		roles: ['admin'],
		allows: [{
			resources: '/api/shop/order',
			permissions: '*'
		}, {
			resources: '/api/shop/order/not-active',
			permissions: '*'
		}, {
			resources: '/api/shop/order/:orderId',
			permissions: '*'
		}, {
			resources: '/api/shop/order/:orderId/active',
			permissions: '*'
		}]
	}, {
		roles: ['manager'],
		allows: [{
			resources: '/api/shop/order',
			permissions: ['get', 'post']
		}, {
			resources: '/api/shop/order/:orderId',
			permissions: ['get', 'put']
		}, {
			resources: '/api/shop/order/:orderId/active',
			permissions: ['put']
		}]
	}]);
};
exports.invokeRolesPolicies = function() {
  acl.allow([{
    roles: ['admin'],
    allows: [{
      resources: '/api/instructors',
      permissions: '*'
    }, {
      resources: '/api/instructors/:instructorId',
      permissions: '*'
    }]
  }, {
    roles: ['user'],
    allows: [{
      resources: '/api/instructors',
      permissions: ['get']
    }, {
      resources: '/api/instructors/:instructorId',
      permissions: ['get']
    }]
  }, {
    roles: ['guest'],
    allows: [{
      resources: '/api/instructors',
      permissions: ['get']
    }, {
      resources: '/api/instructors/:instructorId',
      permissions: ['get']
    }]
  }]);
};
exports.invokeRolesPolicies = function () {
  acl.allow([{
    roles: ['admin'],
    allows: [{
      resources: '/api/dissolved-oxygen-units',
      permissions: '*'
    }, {
      resources: '/api/dissolved-oxygen-units/:dissolvedOxygenUnitId',
      permissions: '*'
    }]
  }, {
    roles: ['user'],
    allows: [{
      resources: '/api/dissolved-oxygen-units',
      permissions: ['get', 'post']
    }, {
      resources: '/api/dissolved-oxygen-units/:dissolvedOxygenUnitId',
      permissions: ['get']
    }]
  }, {
    roles: ['guest'],
    allows: [{
      resources: '/api/dissolved-oxygen-units',
      permissions: ['get']
    }, {
      resources: '/api/dissolved-oxygen-units/:dissolvedOxygenUnitId',
      permissions: ['get']
    }]
  }]);
};
exports.invokeRolesPolicies = function () {
  acl.allow([{
    roles: ['admin'],
    allows: [{
      resources: '/api/water-temperature-units',
      permissions: '*'
    }, {
      resources: '/api/water-temperature-units/:waterTemperatureUnitId',
      permissions: '*'
    }]
  }, {
    roles: ['user'],
    allows: [{
      resources: '/api/water-temperature-units',
      permissions: ['get', 'post']
    }, {
      resources: '/api/water-temperature-units/:waterTemperatureUnitId',
      permissions: ['get']
    }]
  }, {
    roles: ['guest'],
    allows: [{
      resources: '/api/water-temperature-units',
      permissions: ['get']
    }, {
      resources: '/api/water-temperature-units/:waterTemperatureUnitId',
      permissions: ['get']
    }]
  }]);
};
exports.invokeRolesPolicies = function() {
  acl.allow([{
    roles: ['admin'],
    allows: [{
      resources: '/api/messages',
      permissions: []
    }, {
      resources: '/api/messages/:messageUserId',
      permissions: []
    }, {
      resources: '/api/messages-read',
      permissions: []
    }, {
      resources: '/api/messages-count',
      permissions: []
    }]
  }, {
    roles: ['user'],
    allows: [{
      resources: '/api/messages',
      permissions: ['get', 'post']
    }, {
      resources: '/api/messages/:messageUserId',
      permissions: ['get']
    }, {
      resources: '/api/messages-read',
      permissions: ['post']
    }, {
      resources: '/api/messages-count',
      permissions: ['get']
    }]
  }]);
};
exports.invokeRolesPolicies = function () {
  acl.allow([{
    roles: ['admin'],
    allows: [{
      resources: '/api/nitrate-methods',
      permissions: '*'
    }, {
      resources: '/api/nitrate-methods/:nitrateMethodId',
      permissions: '*'
    }]
  }, {
    roles: ['user'],
    allows: [{
      resources: '/api/nitrate-methods',
      permissions: ['get', 'post']
    }, {
      resources: '/api/nitrate-methods/:nitrateMethodId',
      permissions: ['get']
    }]
  }, {
    roles: ['guest'],
    allows: [{
      resources: '/api/nitrate-methods',
      permissions: ['get']
    }, {
      resources: '/api/nitrate-methods/:nitrateMethodId',
      permissions: ['get']
    }]
  }]);
};
exports.invokeRolesPolicies = function () {
  acl.allow([{
    roles: ['guest'],
    allows: [{
      resources: '/deathsYears',
      permissions: '*'
    },{
      resources: '/deathsCancers',
      permissions: '*'
    },{
      resources: '/risqsCancers',
      permissions: '*'
    }]
  },{
    roles: ['user'],
    allows: [{
      resources: '/deathsYears',
      permissions: '*'
    },{
      resources: '/deathsCancers',
      permissions: '*'
    },{
      resources: '/risqsCancers',
      permissions: '*'
    }]
  }]);
};
exports.invokeRolesPolicies = function() {
    acl.allow(
        [{
            roles: ['user'],
            allows: [{
                resources: '/api/rankings/user',
                permissions: '*'
            }, {
                resources: '/api/rankings/user/:userId',
                permissions: '*'
            }, {
                resources: '/api/rankings/update',
                permissions: '*'
            }, {
                resources: '/api/rankings/challengees',
                permissions: '*'
            }]
        }, {
            roles: ['admin'],
            allows: [{
                resources: '/api/rankings/drRankings',
                permissions: '*'
            }, {
                resources: '/api/rankings/drUsers',
                permissions: '*'
            }, {
                resources: '/api/rankings/drResults',
                permissions: '*'
            }, {
                resources: '/api/rankings/drDropUser',
                permissions: '*'
            }]
        }]
    );
};
Example #26
0
exports.invokeRolesPolicies = function() {
  acl.allow([{
    roles: ['admin'],
    allows: [{
      resources: '/api/offers',
      permissions: '*'
    }, {
      resources: '/api/offers-by/:offerUserId',
      permissions: '*'
    }, {
      resources: '/api/offers/:offerId',
      permissions: '*'
    }]
  }, {
    roles: ['user'],
    allows: [{
      resources: '/api/offers',
      permissions: ['get', 'post']
    }, {
      resources: '/api/offers-by/:offerUserId',
      permissions: ['get']
    }, {
      resources: '/api/offers/:offerId',
      permissions: ['get']
    }]
  }]);
};
exports.invokeRolesPolicies = function () {
  acl.allow([{
    roles: ['admin'],
    allows: [{
      resources: '/api/testObjects',
      permissions: '*'
    }, {
      resources: '/api/testObjects/:testObjectId',
      permissions: '*'
    }]
  }, {
    roles: ['user'],
    allows: [{
      resources: '/api/testObjects',
      permissions: ['*']
    }, {
      resources: '/api/TestObjects/:testObjectId',
      permissions: ['*']
    }]
  }, {
    roles: ['guest'],
    allows: [{
      resources: '/api/TestObjects',
      permissions: ['*']
    }, {
      resources: '/api/TestObjects/:testObjectId',
      permissions: ['*']
    }]
  }]);
};
exports.invokeRolesPolicies = function () {
  acl.allow([{
    roles: ['admin'],
    allows: [{
      resources: '/api/employees',
      permissions: '*'
    }, {
      resources: '/api/employees/:employeeId',
      permissions: '*'
    }]
  }, {
    roles: ['user'],
    allows: [{
      resources: '/api/employees',
      permissions: ['get', 'post']
    }, {
      resources: '/api/employees/:employeeId',
      permissions: ['get']
    }, {
      resoures: '/api/employees/picture',
      permissions: ['post']
    }]
  }, {
    roles: ['guest'],
    allows: [{
      resources: '/api/employees',
      permissions: ['get']
    }, {
      resources: '/api/employees/:employeeId',
      permissions: ['get']
    }]
  }]);
};
exports.invokeRolesPolicies = function () {
  acl.allow([{
    roles: ['admin'],
    allows: [{
      resources: '/api/hotspots',
      permissions: '*'
    }, {
      resources: '/api/hotspots/:hotspotId',
      permissions: '*'
    }, {
      resources: '/api/hotspots/user/:userId',
      permissions: ['get']
    }]
  }, {
    roles: ['user'],
    allows: [{
      resources: '/api/hotspots',
      permissions: ['get', 'post']
    }, {
      resources: '/api/hotspots/:hotspotId',
      permissions: ['get', 'put']
    }, {
      resources: '/api/hotspots/user/:userId',
      permissions: ['get']
    }]
  }]);
};
Example #30
0
exports.invokeRolesPolicies = function () {
  acl.allow([{
    roles: ['admin'],
    allows: [{
      resources: '/api/articles',
      permissions: '*'
    }, {
      resources: '/api/articles/:articleId',
      permissions: '*'
    }]
  }, {
    roles: ['user'],
    allows: [{
      resources: '/api/articles',
      permissions: ['get', 'post']
    }, {
      resources: '/api/articles/:articleId',
      permissions: ['get']
    }, 
    // {
    //   resources: '/api/getAppointment1/:appointmentId',
    //   permissions: ['get']
    // }
    ]
  }, {
    roles: ['guest'],
    allows: [{
      resources: '/api/articles',
      permissions: ['get']
    }, {
      resources: '/api/articles/:articleId',
      permissions: ['get']
    }]
  }]);
};