Sha256: c8e4ee4bc93421840b2306376099fe2326dab040d68d48593f57402a40cc9ce9

Contents?: true

Size: 724 Bytes

Versions: 2

Compression:

Stored size: 724 Bytes

Contents

class Iugu::AccountRolesController < Iugu::SettingsController

  def edit
    @account = current_user.accounts.find(params[:id])
    @account_user = @account.account_users.find_by_user_id(params[:user_id])
    if current_user.is?(:owner, @account) || current_user.is?(:admin, @account)
      render 'iugu/account_roles/edit'
    else
      render :file => "#{Rails.root}/public/422.html", :status => 550
    end
  end

  def update
    @account = current_user.accounts.find(params[:id])
    @account_user = @account.account_users.find_by_user_id(params[:user_id])
    @account_user.set_roles(params[:roles])
    redirect_to account_users_index_path(@account.id), :notice => I18n.t("iugu.notices.roles_changed")
  end
  
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
iugusdk-1.0.0.alpha.1 app/controllers/iugu/account_roles_controller.rb
iugusdk-1.0.0.alpha.0 app/controllers/iugu/account_roles_controller.rb