<commit_before>/* global define: false */

'use strict';

var fs = require('fs');

var template = fs.readFileSync(__dirname + '/authorizations.html', 'utf8');
var confirmTemplate = fs.readFileSync(__dirname + '/confirm-delete-authorization.html', 'utf8');

  module.exports = [ '$routeProvider', function($routeProvider) {
    $routeProvider.when('/authorization', {
      template: template,
      controller: [
               '$scope', 'page',      '$routeParams', '$modal', 'AuthorizationResource', 'Notifications', '$location',
      function ($scope,   pageService, $routeParams,   $modal,   AuthorizationResource,   Notifications,   $location) {

        $scope.$root.showBreadcrumbs = true;

        pageService.titleSet('Authorizations');

        pageService.breadcrumbsClear();

        $scope.allPermissionsValue = 2147483647;

        $scope.resourceMap = {
          0: 'Application',
          1: 'User',
          2: 'Group',
          3: 'Group Membership',
          4: 'Authorization',
          5: 'Filter',
          6: 'Process Definition',
          7: 'Task',
          8: 'Process Instance',
          9: 'Deployment',
         10: 'Decision Definition'
        };

        var choices = []
        /*
        // could be some awesome... could...
        choices = Object.keys($scope.resourceMap).map(function (k) {
          return {
            active: $location.search().resource === '' + k,
            label: $scope.resourceMap[k],
            href: '#/authorization?resource=' + k
          };
        });
        */
        pageService.breadcrumbsAdd([
          {
            label: 'Authorizations',
            href: '#/authorization',
            choices: choices
          }
        ]);

        $scope.permissionMap = {
          0: [ 'ACCESS' ],
          1: [ 'READ', 'UPDATE', 'CREATE', 'DELETE' ],
          2: [ 'READ', 'UPDATE', 'CREATE', 'DELETE' ],
          3: [ 'CREATE', 'DELETE' ],
          4: [ 'READ', 'UPDATE', 'CREATE', 'DELETE' ],
          5: [ 'READ', 'UPDATE', 'DELETE' ],
          6: [ 'READ', 'CREATE_INSTANCE', 'READ_INSTANCE', 'UPDATE_INSTANCE', 'DELETE_INSTANCE', 'READ_TASK', 'UPDATE_TASK', 'TASK_ASSIGN', 'TASK_WORK', 'READ_HISTORY', 'DELETE_HISTORY' ],
          7: [ 'CREATE', 'READ', 'UPDATE', 'DELETE', 'TASK_ASSIGN', 'TASK_WORK' ],
          8: [ 'CREATE', 'READ', 'UPDATE', 'DELETE' ],
          9: [ 'CREATE', 'READ', 'DELETE' ],
         10: [ 'READ', 'CREATE_INSTANCE', 'READ_HISTORY', 'DELETE_HISTORY' ]
        };

        $scope.typeMap = {
          0: 'GLOBAL',
          1: 'ALLOW',
          2: 'DENY'
        };

        $scope.getIdentityId = function(auth) {
          if(!!auth.userId) {
            return auth.userId;
          } else {
            return auth.groupId;
          }
        };
<commit_msg>improve(authorizations): remove some unnecessary code<commit_after>/* global define: false */

'use strict';

var fs = require('fs');

var template = fs.readFileSync(__dirname + '/authorizations.html', 'utf8');
var confirmTemplate = fs.readFileSync(__dirname + '/confirm-delete-authorization.html', 'utf8');

  module.exports = [ '$routeProvider', function($routeProvider) {
    $routeProvider.when('/authorization', {
      template: template,
      controller: [
               '$scope', 'page',      '$routeParams', '$modal', 'AuthorizationResource', 'Notifications', '$location',
      function ($scope,   pageService, $routeParams,   $modal,   AuthorizationResource,   Notifications,   $location) {

        $scope.$root.showBreadcrumbs = true;

        pageService.titleSet('Authorizations');

        pageService.breadcrumbsClear();

        $scope.allPermissionsValue = 2147483647;

        $scope.resourceMap = {
          0: 'Application',
          1: 'User',
          2: 'Group',
          3: 'Group Membership',
          4: 'Authorization',
          5: 'Filter',
          6: 'Process Definition',
          7: 'Task',
          8: 'Process Instance',
          9: 'Deployment',
         10: 'Decision Definition'
        };

        pageService.breadcrumbsAdd([
          {
            label: 'Authorizations',
            href: '#/authorization'
          }
        ]);

        $scope.permissionMap = {
          0: [ 'ACCESS' ],
          1: [ 'READ', 'UPDATE', 'CREATE', 'DELETE' ],
          2: [ 'READ', 'UPDATE', 'CREATE', 'DELETE' ],
          3: [ 'CREATE', 'DELETE' ],
          4: [ 'READ', 'UPDATE', 'CREATE', 'DELETE' ],
          5: [ 'READ', 'UPDATE', 'DELETE' ],
          6: [ 'READ', 'CREATE_INSTANCE', 'READ_INSTANCE', 'UPDATE_INSTANCE', 'DELETE_INSTANCE', 'READ_TASK', 'UPDATE_TASK', 'TASK_ASSIGN', 'TASK_WORK', 'READ_HISTORY', 'DELETE_HISTORY' ],
          7: [ 'CREATE', 'READ', 'UPDATE', 'DELETE', 'TASK_ASSIGN', 'TASK_WORK' ],
          8: [ 'CREATE', 'READ', 'UPDATE', 'DELETE' ],
          9: [ 'CREATE', 'READ', 'DELETE' ],
         10: [ 'READ', 'CREATE_INSTANCE', 'READ_HISTORY', 'DELETE_HISTORY' ]
        };

        $scope.typeMap = {
          0: 'GLOBAL',
          1: 'ALLOW',
          2: 'DENY'
        };

        $scope.getIdentityId = function(auth) {
          if(!!auth.userId) {
            return auth.userId;
          } else {
            return auth.groupId;
          }
        };

{'fraction_non_alphanumeric': 0.16720748234395877, 'fraction_numerical': 0.01488833746898263, 'mean_word_length': 2.0987581312832644, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6073714', 'n_tokens_mistral': 1564, 'n_tokens_neox': 1553, 'n_words': 329}