var appModule = angular.module(
"appModule"
, [
'ngRoute'
,
'ngResource'
])
.config(function ($routeProvider, $locationProvider) {
$routeProvider
.when(
'/superUserSpecificRoute'
, {
templateUrl:
'/templates/superUser.html'
,
caseInsensitiveMatch:
true
,
controller:
'superUserController'
,
resolve: {
permission: function (authorizationService, $route) {
return
authorizationService.permissionCheck([roles.superUser]);
},
}
})
.when(
'/userSpecificRoute'
, {
templateUrl:
'/templates/user.html'
,
caseInsensitiveMatch:
true
,
controller:
'userController'
,
resolve: {
permission: function (authorizationService, $route) {
return
authorizationService.permissionCheck([roles.user]);
},
}
})
.when(
'/adminSpecificRoute'
, {
templateUrl:
'/templates/admin.html'
,
caseInsensitiveMatch:
true
,
controller:
'adminController'
,
resolve: {
permission: function (authorizationService, $route) {
return
authorizationService.permissionCheck([roles.admin]);
},
}
})
.when(
'/adminSuperUserSpecificRoute'
, {
templateUrl:
'/templates/adminSuperUser.html'
,
caseInsensitiveMatch:
true
,
controller:
'adminSuperUserController'
,
resolve: {
permission: function (authorizationService, $route) {
return
authorizationService.permissionCheck([roles.admin, roles.superUser]);
},
}
});
});