diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index 47a88e05..9771fc4e 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -16,7 +16,7 @@ class UsersController < ApplicationController
@users.active.where.not(role: 'integration')
end
- @pagy, @users = pagy(@users.where(account: current_account).order(id: :desc))
+ @pagy, @users = pagy(@users.preload(account: :account_accesses).where(account: current_account).order(id: :desc))
end
def new; end
diff --git a/app/models/account.rb b/app/models/account.rb
index 6ad1071e..6265734d 100644
--- a/app/models/account.rb
+++ b/app/models/account.rb
@@ -33,6 +33,7 @@ class Account < ApplicationRecord
has_many :account_linked_accounts, dependent: :destroy
has_many :email_events, dependent: :destroy
has_many :webhook_urls, dependent: :destroy
+ has_many :account_accesses, dependent: :destroy
has_many :account_testing_accounts, -> { testing }, dependent: :destroy,
class_name: 'AccountLinkedAccount',
inverse_of: :account
diff --git a/app/models/account_access.rb b/app/models/account_access.rb
new file mode 100644
index 00000000..162c3703
--- /dev/null
+++ b/app/models/account_access.rb
@@ -0,0 +1,24 @@
+# frozen_string_literal: true
+
+# == Schema Information
+#
+# Table name: account_accesses
+#
+# id :bigint not null, primary key
+# created_at :datetime not null
+# updated_at :datetime not null
+# account_id :bigint not null
+# user_id :bigint not null
+#
+# Indexes
+#
+# index_account_accesses_on_account_id_and_user_id (account_id,user_id) UNIQUE
+#
+# Foreign Keys
+#
+# fk_rails_... (account_id => accounts.id)
+#
+class AccountAccess < ApplicationRecord
+ belongs_to :account
+ belongs_to :user
+end
diff --git a/app/views/templates_dashboard/index.html.erb b/app/views/templates_dashboard/index.html.erb
index 1fd59e73..bcd85b01 100644
--- a/app/views/templates_dashboard/index.html.erb
+++ b/app/views/templates_dashboard/index.html.erb
@@ -56,7 +56,7 @@
<% if @templates.present? %>
<%= render partial: 'templates/template', collection: @templates %>
- <% if show_dropzone && current_user.created_at > 2.weeks.ago || params[:tour] == 'true' %>
+ <% if show_dropzone && (current_user.created_at > 2.weeks.ago || params[:tour] == 'true') && current_user == true_user %>
<% user_config = current_user.user_configs.find_or_initialize_by(key: UserConfig::SHOW_APP_TOUR) %>
<% if user_config.new_record? || user_config.value || params[:tour] == 'true' %>
diff --git a/app/views/users/index.html.erb b/app/views/users/index.html.erb
index e1d10cda..a0849cec 100644
--- a/app/views/users/index.html.erb
+++ b/app/views/users/index.html.erb
@@ -55,8 +55,8 @@
<%= user.email %>
-
- <%= user.role %>
+
+ <%= t(user.role) %>
|
diff --git a/config/locales/i18n.yml b/config/locales/i18n.yml
index 9ab21f97..15ecb073 100644
--- a/config/locales/i18n.yml
+++ b/config/locales/i18n.yml
@@ -469,7 +469,9 @@ en: &en
upload_initials: Upload Initials
draw: Draw
upload_signature: Upload Signature
+ integration: Integration
admin: Admin
+ tenant_admin: Tenant Admin
editor: Editor
viewer: Viewer
member: Member
@@ -1275,7 +1277,9 @@ es: &es
upload_initials: Subir iniciales
draw: Dibujar
upload_signature: Subir firma
+ integration: Integración
admin: Administrador
+ tenant_admin: Tenant Administrador
editor: Editor
viewer: Visor
member: Miembro
@@ -2080,6 +2084,7 @@ it: &it
upload_initials: Carica iniziali
draw: Disegna
upload_signature: Carica firma
+ integration: Integrazione
admin: Amministratore
editor: Editor
viewer: Visualizzatore
@@ -2887,7 +2892,9 @@ fr: &fr
upload_initials: Télécharger les initiales
draw: Dessiner
upload_signature: Télécharger la signature
+ integration: Intégration
admin: Administrateur
+ tenant_admin: Tenant Administrateur
editor: Éditeur
viewer: Lecteur
member: Membre
@@ -3693,7 +3700,9 @@ pt: &pt
upload_initials: Enviar iniciais
draw: Desenhar
upload_signature: Enviar assinatura
+ integration: Integração
admin: Administrador
+ tenant_admin: Tenant Administrador
editor: Editor
viewer: Visualizador
member: Membro
@@ -4500,7 +4509,9 @@ de: &de
upload_initials: Initialen hochladen
draw: Zeichnen
upload_signature: Unterschrift hochladen
+ integration: Integration
admin: Administrator
+ tenant_admin: Tenant Administrator
editor: Redakteur
viewer: Betrachter
member: Mitglied
diff --git a/db/migrate/20250518070555_account_accesses.rb b/db/migrate/20250518070555_account_accesses.rb
new file mode 100644
index 00000000..a5cc2770
--- /dev/null
+++ b/db/migrate/20250518070555_account_accesses.rb
@@ -0,0 +1,14 @@
+# frozen_string_literal: true
+
+class AccountAccesses < ActiveRecord::Migration[8.0]
+ def change
+ create_table :account_accesses do |t|
+ t.references :account, null: false, foreign_key: true, index: false
+ t.references :user, null: false, foreign_key: false, index: false
+
+ t.index %i[account_id user_id], unique: true
+
+ t.timestamps
+ end
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 34aaa8bf..887938d0 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
-ActiveRecord::Schema[8.0].define(version: 2025_02_25_111255) do
+ActiveRecord::Schema[8.0].define(version: 2025_05_18_070555) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@@ -24,6 +24,14 @@ ActiveRecord::Schema[8.0].define(version: 2025_02_25_111255) do
t.index ["user_id"], name: "index_access_tokens_on_user_id"
end
+ create_table "account_accesses", force: :cascade do |t|
+ t.bigint "account_id", null: false
+ t.bigint "user_id", null: false
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
+ t.index ["account_id", "user_id"], name: "index_account_accesses_on_account_id_and_user_id", unique: true
+ end
+
create_table "account_configs", force: :cascade do |t|
t.bigint "account_id", null: false
t.string "key", null: false
@@ -415,6 +423,7 @@ ActiveRecord::Schema[8.0].define(version: 2025_02_25_111255) do
end
add_foreign_key "access_tokens", "users"
+ add_foreign_key "account_accesses", "accounts"
add_foreign_key "account_configs", "accounts"
add_foreign_key "account_linked_accounts", "accounts"
add_foreign_key "account_linked_accounts", "accounts", column: "linked_account_id"
|