summaryrefslogtreecommitdiff
path: root/app/controllers/users_base_controller.rb
blob: 9becf0d15416354a0b3c41e1106083e2255eee3e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#
# 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