<commit_before>'use strict';

// Declare app level module which depends on views, and components
angular.module('myApp', [
    'ui.router',
    'ngAnimate',
    'myApp.welcomeView',
    'myApp.extCustomerView',
    'myApp.extCustomerCsisView',
    'myApp.extCsiView',
    'myApp.intCustomerView',
    'myApp.intCsiView'
])

.controller('appController', function($scope, $route, $stateParams, $location) {
    $scope.$route = $route;
    $scope.$location = $location;
    $scope.$stateParams = $stateParams;
})

.config(['$locationProvider', '$stateProvider', '$urlRouterProvider', function($locationProvider, $stateProvider, $urlRouterProvider)
    {
        $stateProvider
            .state('app', {
              abstract: true,
              // ...
              data: {
                requireLogin: true // this property will apply to all children of 'app'
              }
            })
            .state('app.dashboard', {
              // child state of `app`
              // requireLogin === true
            })

        $locationProvider.hashPrefix('!');
        $urlRouterProvider.otherwise('/extCustomerView');

    }
])


.run(function ($rootScope) {
  $rootScope.$on('$stateChangeStart', function (event, toState, toParams) {
    var requireLogin = toState.data.requireLogin;

    if (requireLogin && typeof $rootScope.currentUser === 'undefined') {
      event.preventDefault();
      // get me a login modal!
    }
  });

});
<commit_msg>test med currentUser<commit_after>'use strict';

// Declare app level module which depends on views, and components
angular.module('myApp', [
    'ui.router',
    'ngAnimate',
    'myApp.welcomeView',
    'myApp.extCustomerView',
    'myApp.extCustomerCsisView',
    'myApp.extCsiView',
    'myApp.intCustomerView',
    'myApp.intCsiView'
])

.controller('appController', function($scope, $route, $stateParams, $location) {
    $scope.$route = $route;
    $scope.$location = $location;
    $scope.$stateParams = $stateParams;
})

.config(['$locationProvider', '$stateProvider', '$urlRouterProvider', function($locationProvider, $stateProvider, $urlRouterProvider)
    {
        var currentUser =
            { 'name': '<NAME>', 'role': 'admin', 'age': 33, 'salary': 123400 }
        ;

        $stateProvider
            .state('app', {
              abstract: true,
              // ...
              data: {
                requireLogin: true // this property will apply to all children of 'app'
              }
            })
            .state('app.dashboard', {
              // child state of `app`
              // requireLogin === true
            })

        $locationProvider.hashPrefix('!');

        if(currentUser.role === "user")
            $urlRouterProvider.otherwise('/intCustomerView');
        if(currentUser.role === "admin")
            $urlRouterProvider.otherwise('/extCustomerView');
    }
])


.run(function ($rootScope) {
  $rootScope.$on('$stateChangeStart', function (event, toState, toParams) {
    var requireLogin = toState.data.requireLogin;

    if (requireLogin && typeof $rootScope.currentUser === 'undefined') {
      event.preventDefault();
      // get me a login modal!
    }
  });

});

{'fraction_non_alphanumeric': 0.1504396984924623, 'fraction_numerical': 0.002512562814070352, 'mean_word_length': 2.443243243243243, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1936458', 'n_tokens_mistral': 918, 'n_tokens_neox': 902, 'n_words': 185}