Sha256: 6b4469aa50fb35e75c5205c07d240d70df83c68d5cf3f196f1a1c58145b5f6ea
Contents?: true
Size: 1.33 KB
Versions: 9
Compression:
Stored size: 1.33 KB
Contents
# frozen_string_literal: true # TODO: mover a pg_scaffold module PgEngine class Configuracion attr_accessor :users_controller, :global_domains, :navigators, :user_profiles # attr_accessor :profile_groups def initialize @global_domains = ['app.localhost.com', 'test.host', 'localhost'] @navigators = [PgEngine::Navigator.new] # @profile_groups = [:account] @user_profiles = { account__owner: 0 } user_profiles.merge!( user_accounts__read: 1000 + 1 ) # add_profiles(:user_accounts, 1000) end def add_profiles(key, base) # profile_groups.push(key) user_profiles.merge!( "#{key}__read": base + 1, "#{key}__update": base + 10, "#{key}__create": base + 30, "#{key}__archive": base + 50, "#{key}__export": base + 80, "#{key}__destroy": base + 100 ) end def profile_groups_options groups = user_profiles.keys.map { |v| v.to_s.split('__').first }.uniq groups = groups.excluding('account') unless Current.namespace == :admin groups.map do |group| options = user_profiles.keys.select { |va| va.starts_with?(group) }.map do |va| [va, I18n.t(va.to_s.split('__').last, scope: 'profile_member')] end { name: group, options: } end end end end
Version data entries
9 entries across 9 versions & 1 rubygems