Skip to content

Commit

Permalink
[api] Make sure that user can't branch packages if allow_user_to_crea…
Browse files Browse the repository at this point in the history
…te_home_project is set to false via string or boolean
  • Loading branch information
kad authored and adrianschroeter committed Jun 20, 2013
1 parent d5e1da3 commit adfb481
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/api/app/models/user.rb
Expand Up @@ -1007,8 +1007,8 @@ def can_create_package_in?(project, ignoreLock=nil)
# project_name is name of the project
def can_create_project?(project_name)
## special handling for home projects
return true if project_name == "home:#{self.login}" and CONFIG['allow_user_to_create_home_project'] != "false"
return true if /^home:#{self.login}:/.match( project_name ) and CONFIG['allow_user_to_create_home_project'] != "false"
return true if project_name == "home:#{self.login}" and CONFIG['allow_user_to_create_home_project'] != false and CONFIG['allow_user_to_create_home_project'] != "false"
return true if /^home:#{self.login}:/.match( project_name ) and CONFIG['allow_user_to_create_home_project'] != false and CONFIG['allow_user_to_create_home_project'] != "false"

return true if has_global_permission? "create_project"
p = Project.find_parent_for(project_name)
Expand Down

0 comments on commit adfb481

Please sign in to comment.