From f159ba353cc30ec828017be9ff5f7e3bc3d62e64 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Adrian=20Schr=C3=B6ter?= Date: Fri, 18 Feb 2011 10:46:33 +0100 Subject: [PATCH] [api] fix permission checking on raising "sourceaccess" permissions --- src/api/app/controllers/source_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/api/app/controllers/source_controller.rb b/src/api/app/controllers/source_controller.rb index 6bae058..6c2b8a5 100644 --- a/src/api/app/controllers/source_controller.rb +++ b/src/api/app/controllers/source_controller.rb @@ -748,7 +748,7 @@ class SourceController < ApplicationController end p = Project.new(request_data, :name => project_name) - if @project and not @project.disabled_for?('sourceaccess', nil, nil) + if @project and not @project.disabled_for?('sourceaccess', nil, nil) and not @http_user.is_admin? if p.disabled_for? :sourceaccess render_error :status => 403, :errorcode => "change_project_protection_level", :message => "admin rights are required to raise the source protection level of a project" @@ -756,7 +756,7 @@ class SourceController < ApplicationController end end - if @project and not @project.disabled_for?('access', nil, nil) + if @project and not @project.disabled_for?('access', nil, nil) and not @http_user.is_admin? if p.disabled_for? :access render_error :status => 403, :errorcode => "change_project_protection_level", :message => "admin rights are required to raise the protection level of a project" -- 2.1.4