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:
Sojan Jose
2020-05-11 23:07:22 +05:30
committed by GitHub
parent 8859880e55
commit c74b5c21d7
37 changed files with 964 additions and 35 deletions

View File

@@ -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