summaryrefslogtreecommitdiff
path: root/users/app/controllers/users_base_controller.rb
blob: dc2fa1684ed96cfe00c03cd7b94767f89c369def (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_by_param(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