diff options
author | Simon Brandhof <simon.brandhof@sonarsource.com> | 2016-09-26 16:38:13 +0200 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@sonarsource.com> | 2016-10-05 13:18:11 +0200 |
commit | ac56b7dfeb4252dec8594f8869913b88da3d996c (patch) | |
tree | a004701ae697b512e8fee921b997ba94928023fa /server/sonar-web/src/main/webapp/WEB-INF/app/models/user_role.rb | |
parent | d901a2ade4aee181ba26d2e1522201cf09ce40d5 (diff) | |
download | sonarqube-ac56b7dfeb4252dec8594f8869913b88da3d996c.tar.gz sonarqube-ac56b7dfeb4252dec8594f8869913b88da3d996c.zip |
Remove ruby dead code related to roles
Diffstat (limited to 'server/sonar-web/src/main/webapp/WEB-INF/app/models/user_role.rb')
-rw-r--r-- | server/sonar-web/src/main/webapp/WEB-INF/app/models/user_role.rb | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/models/user_role.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/models/user_role.rb index d9e91113910..a80ca615ade 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/models/user_role.rb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/models/user_role.rb @@ -18,21 +18,5 @@ # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # class UserRole < ActiveRecord::Base - belongs_to :user - belongs_to :resource, :class_name => 'Project', :foreign_key => "resource_id" - def self.grant_users(user_ids, role, resource_id) - resource_id=(resource_id.blank? ? nil : resource_id.to_i) - if resource_id - UserRole.delete_all(["role=? and resource_id=?", role, resource_id]) - else - UserRole.delete_all(["role=? and resource_id is null", role]) - end - - if user_ids - user_ids.compact.uniq.each do |user_id| - UserRole.create(:user_id => user_id, :role=> role, :resource_id => resource_id) - end - end - end end |