Project

General

Profile

« Previous | Next » 

Revision c7f55be1

Added by Ori Rabin almost 8 years ago

Fixes #13164 - Add view_params permission

A new view_params permission was added for parameters inheriting from
Parameter object. The only exception is global parameters, which are
already handled by filter for CommonParameter resource.

This new permissions is also automatically added to viewer and site
manager roles, as well as any other roles with any of the existing
Parameters permissions.

With the patch it's now also possible to use granular filters for all
parameters that Foreman supports.

Contributions from:

View differences:

test/functional/organizations_controller_test.rb
put :update, { :id => organization.id, :organization => {:name => "Topbar Org" }}, set_session_user
end
test 'user with view_params rights should see parameters in an os' do
setup_user "edit", "organizations"
setup_user "view", "params"
organization = FactoryGirl.create(:organization, :with_parameter)
get :edit, {:id => organization.id}, set_session_user.merge(:user => users(:one).id)
assert_not_nil response.body['Parameter']
end
test 'user without view_params rights should not see parameters in an os' do
setup_user "edit", "organizations"
organization = FactoryGirl.create(:organization, :with_parameter)
get :edit, {:id => organization.id}, set_session_user.merge(:user => users(:one).id)
assert_nil response.body['Parameter']
end
context 'wizard' do
test 'redirects to step 2 if unassigned hosts exist' do
host = FactoryGirl.create(:host)

Also available in: Unified diff