Bulk update all users personal project limits

People often ask why after changing default projects limit users can still create more projects.

This setting is for newly created users. You can check that old users limits did not change (check Admin area > Overview > Users > Edit user > Projects limit)

This is an example gitlab-rails console snippet that will update all non-admin users personal project limit to 5.

If you want to update all, including admins, just remove if not u.admin? and first end (the one right after u.save)

User.all.each do |u|
  if not u.admin?
    puts u.username
    puts u.projects_limit
    u.projects_limit=5
    u.save
  end
  puts u.username
  puts u.projects_limit
end

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.