<commit_before>require_relative '../workspace'

module Lanes
    module Access
        class Extension < Lanes::Extensions::Definition

            identifier "lanes-access"

            components :modal, :grid, :select_field

            root_path Pathname.new(__FILE__).dirname.expand_path

            def stylesheet_include
                'lanes/access/styles'
            end

            def javascript_include
                'lanes/access'
            end

            def client_namespace
                'Access'
            end

            def client_paths
                []
            end

            def client_bootstrap_data(view)
                data = { roles: Lanes::Access::Role.all_available }
                if (user_id = view.session['user_id']) && (user = Lanes::User.where( id: user_id ).first)
                    data.merge!(user.workspace_data)
                end
                data
            end

        end

    end
end<commit_msg>roles is set by user.workspace_data<commit_after>require_relative '../workspace'

module Lanes
    module Access
        class Extension < Lanes::Extensions::Definition

            identifier "lanes-access"

            components :modal, :grid, :select_field

            root_path Pathname.new(__FILE__).dirname.expand_path

            def stylesheet_include
                'lanes/access/styles'
            end

            def javascript_include
                'lanes/access'
            end

            def client_namespace
                'Access'
            end

            def client_paths
                []
            end

            def client_bootstrap_data(view)
                data = {}
                if (user_id = view.session['user_id']) && (user = Lanes::User.where( id: user_id ).first)
                    data.merge!(user.workspace_data)
                end
                data
            end

        end

    end
end
{'fraction_non_alphanumeric': 0.07328482328482329, 'fraction_numerical': 0.0, 'mean_word_length': 1.319277108433735, 'pattern_counts': {'":': 0, '<': 5, '<?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': '2203521', 'n_tokens_mistral': 504, 'n_tokens_neox': 461, 'n_words': 105}