add cancan for authorization

This commit is contained in:
Alex Turchyn committed 2023-09-17 00:45:57 +03:00
1 parent f89c50d096
commit 2f1843151d
58 files changed
+341 -184

No files matched your search

+7
View File
@@ -9,6 +9,9 @@ class AccountsController < ApplicationController
'de-DE' => 'German (Germany)'
}.freeze
before_action :load_account
authorize_resource :account
def show; end
def update
@@ -35,6 +38,10 @@ class AccountsController < ApplicationController
private
def load_account
@account = current_account
end
def account_params
params.require(:account).permit(:name, :timezone, :locale)
end