Mailinglist Archive: opensuse-buildservice (233 mails)

< Previous Next >
[opensuse-buildservice] Bug in branch creation.
If a user tries to create a branch and has not created their home
project, then the branch creation will fail with a permission error
because only home:#{self.login} is special cased in can_create_project?
and not home:#{self.login} and all subprojects of it. If
home:#{self.login} is created before creating a subproject this isn't a
problem because of has_local_permission? walking up the tree until it
find a project where the user has a role, but without home:#{self.login}
existing, the walk of the tree will hit 'home' when looking for
permissions and only Admins will have permissions there.

I've attached a patch so the special case is extended to
home:#{self.login} or any subproject of it.

This may be fixed in the newer code or a different location in the code,
I've only checked
https://forgesvn1.novell.com/svn/opensuse/trunk/buildservice/src/frontend/app/models/user.rb
and it looks the same as the 1.0 stuff I'm running.

Index: buildservice/src/frontend/app/models/user.rb
===================================================================
--- buildservice/src/frontend/app/models/user.rb (revision 1638)
+++ buildservice/src/frontend/app/models/user.rb (working copy)
@@ -128,8 +128,8 @@

# 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}"
+ ## special handling for home projects and subprojects
+ return true if /^home:#{login}(:.*)?$/ =~ project_name

return true if has_global_permission? "create_project"
return has_local_permission?( "create_project",
DbProject.find_parent_for(project_name))
< Previous Next >
This Thread
  • No further messages