diff options
Diffstat (limited to 'sonar-server')
6 files changed, 8 insertions, 8 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/dashboards_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/dashboards_controller.rb index 7c1eda69947..89e3b42a34f 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/dashboards_controller.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/dashboards_controller.rb @@ -186,7 +186,7 @@ class DashboardsController < ApplicationController dashboard.name = params[:name] dashboard.description = params[:description] dashboard.is_global = params[:global].present? - dashboard.shared = params[:shared].present? && has_role?(:sharedashboard) + dashboard.shared = params[:shared].present? && has_role?(:shareDashboard) dashboard.column_layout = Dashboard::DEFAULT_LAYOUT if !dashboard.column_layout dashboard.user = User.find_active_by_login(params[:owner]) unless params[:owner].nil? end diff --git a/sonar-server/src/main/webapp/WEB-INF/app/models/dashboard.rb b/sonar-server/src/main/webapp/WEB-INF/app/models/dashboard.rb index ce5cc5673c1..8db5e3f6f0e 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/models/dashboard.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/models/dashboard.rb @@ -46,7 +46,7 @@ class Dashboard < ActiveRecord::Base end def user_rights_consistency - if shared? && user && !user.has_role?(:sharedashboard) + if shared? && user && !user.has_role?(:shareDashboard) errors.add(:user, "cannot own this dashboard because of insufficient rights") end end @@ -84,7 +84,7 @@ class Dashboard < ActiveRecord::Base end def can_be_shared_by(user) - owner?(user) && user.has_role?(:sharedashboard) + owner?(user) && user.has_role?(:shareDashboard) end def can_be_reassigned_by(user) diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/dashboards/_create_form.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/dashboards/_create_form.html.erb index 5fbe198f9fd..de9d5d61151 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/dashboards/_create_form.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/dashboards/_create_form.html.erb @@ -22,7 +22,7 @@ <label for="description"><%= h message('description') -%></label> <input id="description" name="description" type="text" size="50" maxlength="4000" value="<%= h @dashboard.description -%>"/> </div> - <% if has_role?(:sharedashboard) %> + <% if has_role?(:shareDashboard) %> <div class="modal-field"> <label for="shared"><%= h message('shared') -%></label> <input id="shared" name="shared" type="checkbox" value="true" <%= 'checked' if @dashboard.shared -%>/> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/roles/global.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/roles/global.html.erb index 5f47c60911d..e8489ee6041 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/roles/global.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/roles/global.html.erb @@ -9,7 +9,7 @@ </tr> </thead> <tbody> - <% ['admin', 'profileadmin', 'sharedashboard', 'scan', 'dryrun'].each do |global_permissions| %> + <% ['admin', 'profileadmin', 'shareDashboard', 'scan', 'dryrun'].each do |global_permissions| %> <tr class="<%= cycle('even', 'odd', :name => 'global_permission') -%>" > <td valign="top"> <b><%= message('global_permissions.' + global_permissions) -%></b><br/> diff --git a/sonar-server/src/main/webapp/WEB-INF/db/migrate/413_add_dashboard_sharing_permission.rb b/sonar-server/src/main/webapp/WEB-INF/db/migrate/413_add_dashboard_sharing_permission.rb index 222d27aea29..4d6e02140d9 100644 --- a/sonar-server/src/main/webapp/WEB-INF/db/migrate/413_add_dashboard_sharing_permission.rb +++ b/sonar-server/src/main/webapp/WEB-INF/db/migrate/413_add_dashboard_sharing_permission.rb @@ -34,13 +34,13 @@ class AddDashboardSharingPermission < ActiveRecord::Migration group_roles=GroupRole.find(:all, :conditions => {:role => 'admin', :resource_id => nil}) groups = group_roles.map { |ur| ur.group_id } groups.each do |group_id| - GroupRole.create(:group_id => group_id, :role => 'sharedashboard', :resource_id => nil) + GroupRole.create(:group_id => group_id, :role => 'shareDashboard', :resource_id => nil) end user_roles=UserRole.find(:all, :conditions => {:role => 'admin', :resource_id => nil}) users = user_roles.map { |ur| ur.user_id } users.each do |user_id| - UserRole.create(:user_id => user_id, :role=> 'sharedashboard', :resource_id => nil) + UserRole.create(:user_id => user_id, :role=> 'shareDashboard', :resource_id => nil) end end diff --git a/sonar-server/src/main/webapp/WEB-INF/lib/need_authorization.rb b/sonar-server/src/main/webapp/WEB-INF/lib/need_authorization.rb index b6f4e02163e..9e30a77d36f 100644 --- a/sonar-server/src/main/webapp/WEB-INF/lib/need_authorization.rb +++ b/sonar-server/src/main/webapp/WEB-INF/lib/need_authorization.rb @@ -59,7 +59,7 @@ module NeedAuthorization def has_role?(role, objects=nil) if objects.nil? role_symbol=role.to_sym - if role_symbol==:admin || role_symbol==:profileadmin || role_symbol==:sharedashboard || role_symbol==:scan || role_symbol==:dryrun + if role_symbol==:admin || role_symbol==:profileadmin || role_symbol==:shareDashboard || role_symbol==:scan || role_symbol==:dryrun AuthorizerFactory.authorizer.has_role?(self, role_symbol) else # There's no concept of global users or global codeviewers. |