diff --git a/app/controllers/concerns/authorization.rb b/app/controllers/concerns/authorization.rb index 1fb9b2e8..bf73682b 100644 --- a/app/controllers/concerns/authorization.rb +++ b/app/controllers/concerns/authorization.rb @@ -13,7 +13,7 @@ def authorize # Check if all actions are allowed def all_actions_allowed? - return true if has_required_role?('Administrator') + return true if has_required_role?('Super Administrator') action_allowed? end diff --git a/spec/controllers/concerns/authorization_spec.rb b/spec/controllers/concerns/authorization_spec.rb index 51944a80..4f083560 100644 --- a/spec/controllers/concerns/authorization_spec.rb +++ b/spec/controllers/concerns/authorization_spec.rb @@ -128,7 +128,7 @@ describe '#all_actions_allowed?' do context 'when the user has the Administrator role' do before do - allow(controller).to receive(:has_required_role?).with('Administrator').and_return(true) + allow(controller).to receive(:has_required_role?).with('Super Administrator').and_return(true) end it 'returns true' do @@ -138,7 +138,7 @@ context 'when the user does not have the Administrator role' do before do - allow(controller).to receive(:has_required_role?).with('Administrator').and_return(false) + allow(controller).to receive(:has_required_role?).with('Super Administrator').and_return(false) allow(controller).to receive(:action_allowed?).and_return(false) end @@ -149,7 +149,7 @@ context 'when action_allowed? returns true' do before do - allow(controller).to receive(:has_required_role?).with('Administrator').and_return(false) + allow(controller).to receive(:has_required_role?).with('Super Administrator').and_return(false) allow(controller).to receive(:action_allowed?).and_return(true) end