Feature: Introduce Super Admins (#705)
* Feature: Introduce Super Admins - added new devise model for super user - added administrate gem - sample dashboards for users and accounts Co-authored-by: Pranav Raj Sreepuram <pranavrajs@gmail.com>
This commit is contained in:
@@ -16,7 +16,8 @@ class Api::V1::Accounts::AccountsController < Api::BaseController
|
||||
def create
|
||||
@user = AccountBuilder.new(
|
||||
account_name: account_params[:account_name],
|
||||
email: account_params[:email]
|
||||
email: account_params[:email],
|
||||
confirmed: confirmed?
|
||||
).perform
|
||||
if @user
|
||||
send_auth_headers(@user)
|
||||
@@ -40,6 +41,10 @@ class Api::V1::Accounts::AccountsController < Api::BaseController
|
||||
authorize(Account)
|
||||
end
|
||||
|
||||
def confirmed?
|
||||
super_admin? && params[:confirmed]
|
||||
end
|
||||
|
||||
def fetch_account
|
||||
@account = current_user.accounts.find(params[:id])
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user