New migration to add better auditing to user_roles and better column names there...
[rails.git] / app / controllers / user_roles_controller.rb
index 7e56693df5c4c44ba362183e7717da4f99c7e2ee..9064b811d0a1f3a43270ae1ac2f73c75e1e328ff 100644 (file)
@@ -10,7 +10,7 @@ class UserRolesController < ApplicationController
     if params[:nonce] and params[:nonce] == session[:nonce]
       this_user = User.find_by_display_name(params[:display_name], :conditions => {:visible => true})
       if this_user and UserRole::ALL_ROLES.include? params[:role]
-        this_user.roles.create(:role => params[:role])
+        this_user.roles.create(:role => params[:role], :granter_id => @user.id)
         redirect_to :controller => 'user', :action => 'view', :display_name => params[:display_name]
       else
         flash[:notice] = t('user_role.grant.fail', :role => params[:role], :name => params[:display_name])