[email protected] wrote: > From: martyntaylor <[email protected]> > > --- > src/app/controllers/users_controller.rb | 4 +++- > 1 files changed, 3 insertions(+), 1 deletions(-) > > diff --git a/src/app/controllers/users_controller.rb > b/src/app/controllers/users_controller.rb > index 7047517..ebe0e8a 100644 > --- a/src/app/controllers/users_controller.rb > +++ b/src/app/controllers/users_controller.rb > @@ -140,7 +140,9 @@ class UsersController < ApplicationController > if @current_user.permissions.collect { |p| p.role }.find { |r| r.name == > "Administrator" } > if request.post? || request.delete? > @user = User.find(params[:id]) > - if @user.destroy > + if @user == @current_user > + flash[:notice] = "Can not delete the currently logged in user!" > + elsif @user.destroy > flash[:notice] = "User Deleted" > else > flash[:error] = { > ACK
Scott _______________________________________________ deltacloud-devel mailing list [email protected] https://fedorahosted.org/mailman/listinfo/deltacloud-devel
