From bcc26106d74a301df09e02d07572ffe90dfb429b Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Thu, 24 Jan 2013 13:23:24 +0100 Subject: Don't let the admin pull out the rug for his/her own account. --- app/models/ability.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'app/models/ability.rb') diff --git a/app/models/ability.rb b/app/models/ability.rb index b846af0..0d13dab 100644 --- a/app/models/ability.rb +++ b/app/models/ability.rb @@ -82,6 +82,10 @@ class Ability # cannot [:create, :destroy], GsParameter cannot [:create, :destroy], GuiFunction + + # An admin can not destroy his/her account + # + cannot [:destroy], User, :id => user.id else # Any user can do the following stuff. # -- cgit v1.2.3