summaryrefslogtreecommitdiff
path: root/chef-server-api/app
diff options
context:
space:
mode:
authorsdelano <stephen@opscode.com>2010-06-02 19:54:04 -0700
committerDaniel DeLeo <dan@opscode.com>2010-06-03 12:22:15 -0700
commitae3cdccbdfe9daabf359ce774499a5c969497722 (patch)
tree5dc10dfe7acaa8adc0ee06fee76ddddc0ddb8738 /chef-server-api/app
parentbdbf0e070bc375b92c37a9ee3a463f1ed4fcec54 (diff)
downloadchef-ae3cdccbdfe9daabf359ce774499a5c969497722.tar.gz
raise forbidden instead of unauth when appropriate
Diffstat (limited to 'chef-server-api/app')
-rw-r--r--chef-server-api/app/controllers/application.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/chef-server-api/app/controllers/application.rb b/chef-server-api/app/controllers/application.rb
index e36c2f2fa8..aec7bb8ca2 100644
--- a/chef-server-api/app/controllers/application.rb
+++ b/chef-server-api/app/controllers/application.rb
@@ -56,7 +56,7 @@ class Application < Merb::Controller
if @auth_user.admin
true
else
- raise Unauthorized, "You are not allowed to take this action."
+ raise Forbidden, "You are not allowed to take this action."
end
end
@@ -64,7 +64,7 @@ class Application < Merb::Controller
if @auth_user.admin || @auth_user.name == Chef::Config[:validation_client_name]
true
else
- raise Unauthorized, "You are not allowed to take this action."
+ raise Forbidden, "You are not allowed to take this action."
end
end
@@ -72,7 +72,7 @@ class Application < Merb::Controller
if @auth_user.admin || @auth_user.name == params[:id]
true
else
- raise Unauthorized, "You are not the correct node (auth_user name: #{@auth_user.name}, params[:id]: #{params[:id]}), or are not an API administrator (admin: #{@auth_user.admin})."
+ raise Forbidden, "You are not the correct node (auth_user name: #{@auth_user.name}, params[:id]: #{params[:id]}), or are not an API administrator (admin: #{@auth_user.admin})."
end
end