<commit_before>WorkspaceSidenavDirective.$inject = ['superdeskFlags', '$location', 'Keys', 'gettext', 'config',
    '$route', 'api', '$filter', '$rootScope', 'workspaces'];
export function WorkspaceSidenavDirective(superdeskFlags, $location, Keys, gettext, config,
    $route, api, $filter, $rootScope, workspaces) {
    return {
        templateUrl: 'scripts/apps/workspace/views/workspace-sidenav-items.html',
        link: function(scope, elem) {
            scope.workspaceConfig = config.workspace || {};
            scope.extraItems = workspaces.extraItems || [];

            /*
             * Function for showing and hiding monitoring list
             * while authoring view is opened.
             *
             * @param {boolean} state Gets the state of button<commit_msg>[SDESK-88] Plugins registering to superdesk main instance to be visible only if the user has privileges<commit_after>WorkspaceSidenavDirective.$inject = ['superdeskFlags', '$location', 'Keys', 'gettext', 'config',
    '$route', 'api', '$filter', '$rootScope', 'workspaces', 'privileges'];
export function WorkspaceSidenavDirective(superdeskFlags, $location, Keys, gettext, config,
    $route, api, $filter, $rootScope, workspaces, privileges) {
    return {
        templateUrl: 'scripts/apps/workspace/views/workspace-sidenav-items.html',
        link: function(scope, elem) {
            scope.workspaceConfig = config.workspace || {};

            // Filter extraItems based on privileges
            if (workspaces.extraItems) {
                scope.extraItems = workspaces.extraItems.filter((item) => privileges.userHasPrivileges(item.privilege));
            } else {
                scope.extraItems = [];
            }

            /*
             * Function for showing and hiding monitoring list
             * while authoring view is opened.
             *
             * @param {boolean} state Gets the state of button
{'fraction_non_alphanumeric': 0.12004175365344467, 'fraction_numerical': 0.0010438413361169101, 'mean_word_length': 2.7810650887573964, 'pattern_counts': {'":': 0, '<': 3, '<?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': '5711328', 'n_tokens_mistral': 522, 'n_tokens_neox': 502, 'n_words': 132}