From 9a24ccdea1dd4dc82ac7f24c1fa1706a20949898 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets <dzaporozhets@sphereconsultinginc.com> Date: Thu, 16 Feb 2012 09:04:56 +0200 Subject: [PATCH] Fixed mistype in permissions, Fixed migration --- app/views/help/permissions.html.haml | 2 +- db/migrate/20120216085842_move_to_roles_permissions.rb | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/views/help/permissions.html.haml b/app/views/help/permissions.html.haml index e652417e0e..5c7ba54ca4 100644 --- a/app/views/help/permissions.html.haml +++ b/app/views/help/permissions.html.haml @@ -1,7 +1,7 @@ %h3 Permissions %hr -%h4 Reporter +%h4 Guest %ul %li Create new issue %li Create new merge request diff --git a/db/migrate/20120216085842_move_to_roles_permissions.rb b/db/migrate/20120216085842_move_to_roles_permissions.rb index ee9ffea404..36d02cf972 100644 --- a/db/migrate/20120216085842_move_to_roles_permissions.rb +++ b/db/migrate/20120216085842_move_to_roles_permissions.rb @@ -5,8 +5,12 @@ class MoveToRolesPermissions < ActiveRecord::Migration repo_rw = 2 project_rwa = 3 + + # Build masters and reset repo_access + UsersProject.update_all({:project_access => UsersProject::MASTER, :repo_access => 99 }, ["project_access = ?", project_rwa]) + + # Build other roles based on repo access UsersProject.update_all ["project_access = ?", UsersProject::DEVELOPER], ["repo_access = ?", repo_rw] - UsersProject.update_all ["project_access = ?", UsersProject::MASTER], ["project_access = ?", project_rwa] UsersProject.update_all ["project_access = ?", UsersProject::REPORTER], ["repo_access = ?", repo_r] UsersProject.update_all ["project_access = ?", UsersProject::GUEST], ["repo_access = ?", repo_n] -- 2.30.9