mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Adding routes for a new admin account page for users to manage their billing preferences and access invoices
This commit is contained in:
@@ -90,6 +90,8 @@ class AbilityDecorator
|
||||
end
|
||||
|
||||
can [:admin, :known_users], :search
|
||||
|
||||
can [:admin, :show], :account
|
||||
end
|
||||
|
||||
def add_product_management_abilities(user)
|
||||
|
||||
@@ -110,6 +110,8 @@ Openfoodnetwork::Application.routes.draw do
|
||||
get :start_job
|
||||
end
|
||||
end
|
||||
|
||||
resource :account, only: [:show], controller: 'account'
|
||||
end
|
||||
|
||||
namespace :api do
|
||||
|
||||
@@ -477,6 +477,10 @@ module Spree
|
||||
user
|
||||
end
|
||||
|
||||
it 'should have the ability to view the admin account page' do
|
||||
should have_ability([:admin, :show], for: :account)
|
||||
end
|
||||
|
||||
it 'should have the ability to read and edit enterprises that I manage' do
|
||||
should have_ability([:read, :edit, :update, :bulk_update], for: s1)
|
||||
end
|
||||
@@ -505,6 +509,10 @@ module Spree
|
||||
it 'should have the ability to welcome and register enterprises that I own' do
|
||||
should have_ability([:welcome, :register], for: s1)
|
||||
end
|
||||
|
||||
it 'should have the ability to view the admin account page' do
|
||||
should have_ability([:admin, :show], for: :account)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user