Displaying 1 result from an estimated 1 matches for "auth_by_typ".
Did you mean:
auth_by_type
2006 Jan 16
1
[roles/users]I give up, please help
...ny :users, :join_table =>"users_usertypes"
end
> in the user_controller (or application controller) are methods like this
> (sadly i cant gettem to work)
> # this method should verify if the active user has an ''admin'' usertype
> # connected to it
def auth_by_type(type)
@user = User.find(@session[:user_id]) #this searches for current user
if @user.usertype == type
flash[:notice] = "You are authorized as an #{type}"
else
flash[:notice] = "You are not authorized to view this page..."
redirect_to :action=>:login
end
e...