diff options
author | Azul <azul@leap.se> | 2014-07-14 15:49:31 +0200 |
---|---|---|
committer | Azul <azul@leap.se> | 2014-07-14 15:58:30 +0200 |
commit | 67f70b31bd16b05759e1f8393f077ee17f2c34be (patch) | |
tree | c269a2a342fdc6974cbf55586eb12832bb45e25e /app/controllers/users_base_controller.rb | |
parent | f07c952c870bfb8634ef0d80737b67a1eec760f6 (diff) |
move fetch_user into module so it can be mixed in
We have an ApiController that wants to call #fetch_user. Since we can only inherit from one class i moved fetch_user into an extension.
Diffstat (limited to 'app/controllers/users_base_controller.rb')
-rw-r--r-- | app/controllers/users_base_controller.rb | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/app/controllers/users_base_controller.rb b/app/controllers/users_base_controller.rb deleted file mode 100644 index 9becf0d..0000000 --- a/app/controllers/users_base_controller.rb +++ /dev/null @@ -1,18 +0,0 @@ -# -# common base class for all user related controllers -# - -class UsersBaseController < ApplicationController - - protected - - def fetch_user - @user = User.find(params[:user_id] || params[:id]) - if !@user && admin? - redirect_to users_url, :alert => t(:no_such_thing, :thing => 'user') - elsif !admin? && @user != current_user - access_denied - end - end - -end |