{"size": 494, "ext": "js", "max_stars_repo_path": "routes/admin/permission.js", "max_stars_repo_name": "leonlin14/react-calendar", "max_stars_repo_stars_event_min_datetime": "2015-08-11T21:47:37.000Z", "max_stars_repo_stars_event_max_datetime": "2021-09-16T16:34:55.000Z", "max_issues_repo_path": "routes/admin/permission.js", "max_issues_repo_name": "leonlin14/react-calendar", "max_issues_repo_issues_event_min_datetime": "2015-11-15T09:51:56.000Z", "max_issues_repo_issues_event_max_datetime": "2016-10-09T16:14:21.000Z", "max_forks_repo_path": "routes/admin/permission.js", "max_forks_repo_name": "leonlin14/react-calendar", "max_forks_repo_forks_event_min_datetime": "2015-09-23T14:41:30.000Z", "max_forks_repo_forks_event_max_datetime": "2019-10-12T08:23:26.000Z"}
{"max_stars_count": 121, "max_issues_count": 6, "max_forks_count": 28, "avg_line_length": 19.76, "max_line_length": 62, "alphanum_fraction": 0.6963562753}
var Router = require('koa-router');

module.exports = function(lApp) {

	var router = new Router();

	var Middleware = lApp.getLibrary('Middleware');
	var Permission = lApp.getLibrary('Permission');

	Middleware.allow('admin.access')

	router.get('/admin/api/perms', function *() {

		// Fetching a list with specific condition
		var availPerms = yield Permission.getAvailablePermissions();

		this.body = {
			groups: availPerms.groups,
			list: availPerms.perms
		};
	});

	return router;
};
