acl in routes

This commit is contained in:
Daniel Herrero 2017-11-09 11:39:41 +01:00
parent 865d106d4f
commit c74bafae7e
6 changed files with 13 additions and 9 deletions

View File

@ -7,7 +7,8 @@
{
"url": "/clients",
"state": "clients",
"component": "vn-client-index"
"component": "vn-client-index",
"acl": ["employee"]
}, {
"url": "/create",
"state": "create",

View File

@ -7,7 +7,8 @@
{
"url": "/locator",
"state": "locator",
"component": "vn-locator-index"
"component": "vn-locator-index",
"acl": ["developer"]
}
]
}

View File

@ -7,7 +7,8 @@
{
"url": "/production",
"state": "production",
"component": "vn-production-index"
"component": "vn-production-index",
"acl": ["employee"]
}
]
}

View File

@ -4,7 +4,7 @@ export class ProductionTable {
constructor($filter) {
this.$filter = $filter;
this._tickets = [];
this.itemsDisplayedInList = 16;
this.itemsDisplayedInList = 14;
this._checkAll = 0;
this.pageTable = {
filter: {

View File

@ -14,7 +14,7 @@
"url": "/list",
"state": "routes.index",
"component": "vn-route-index",
"acl": ["employee"]
"acl": ["developer"]
},
{
"url": "/create",
@ -43,6 +43,7 @@
"url": "/logisticData",
"state": "routes.card.logisticData",
"component": "vn-route-logistic-data",
"acl": ["employee"],
"params": {
"route": "$ctrl.route"
},

View File

@ -37,10 +37,10 @@ function config($stateProvider, $urlRouterProvider, aclServiceProvider) {
template: '<vn-home></vn-home>'
});
for (let file in routes) {
let fileRoutes = routes[file].routes;
let moduleName = routes[file].module;
let validations = routes[file].validations || false;
for (let file in window.routes) {
let fileRoutes = window.routes[file].routes;
let moduleName = window.routes[file].module;
let validations = window.routes[file].validations || false;
fileRoutes.forEach(function(route) {
if (aclService.routeHasPermission(route)) {
$stateProvider.state(route.state, {