2019-12-17 18:47:37 +00:00
|
|
|
export function initialize(container) {
|
2021-05-26 16:43:46 +00:00
|
|
|
const env = container.lookup('service:env');
|
|
|
|
if (env.var('CONSUL_NSPACES_ENABLED')) {
|
2020-07-09 09:08:47 +00:00
|
|
|
// enable the nspace repo
|
2019-12-17 18:47:37 +00:00
|
|
|
['dc', 'settings', 'dc.intentions.edit', 'dc.intentions.create'].forEach(function(item) {
|
|
|
|
container.inject(`route:${item}`, 'nspacesRepo', 'service:repository/nspace/enabled');
|
|
|
|
container.inject(`route:nspace.${item}`, 'nspacesRepo', 'service:repository/nspace/enabled');
|
|
|
|
});
|
|
|
|
container.inject('route:application', 'nspacesRepo', 'service:repository/nspace/enabled');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default {
|
|
|
|
initialize,
|
|
|
|
};
|