Project

General

Profile

« Previous | Next » 

Revision 614f6ef1

Added by Dominic Cleal about 8 years ago

fixes #14000 - respect custom controller permissions

Allows controller_permission method to override the permission suffix
used in resource_scope, originally from a63aa7c and removed in bb39df2.

(cherry picked from commit f05b9307fe36d877364b0ee5bee7212c3315c97e)

View differences:

test/functional/api/v2/config_templates_controller_test.rb
get :index, { :operatingsystem_id => operatingsystems(:centos5_3).fullname }
assert_response :success
end
test "should list templates with non-admin user" do
setup_user('view', 'provisioning_templates')
get :index, {}, set_session_user.merge(:user => User.current.id)
assert_response :success
templates = ActiveSupport::JSON.decode(@response.body)
assert !templates.empty?, "Should respond with templates"
end
test "should show template with non-admin user" do
setup_user('view', 'provisioning_templates')
get :show, { :id => templates(:pxekickstart).to_param }, set_session_user.merge(:user => User.current.id)
assert_response :success
end
end

Also available in: Unified diff