Displaying 1 result from an estimated 1 matches for "scoped_options".
2006 Jun 26
0
How to limit access to model objects based on role?
...s_control :DEFAULT => ''(Administrator | SuperUser)''
def edit
set_category_with_scope(params[:id])
end
def update
set_category_with_scope(params[:id])
@category.update_attributes(params[:category])
end
def set_category_with_scope(*args)
Category.with_scope(:find => scoped_options) do
@category = Category.find(*args)
end
end
def scoped_finder_conditions
@scoped_finder_conditions ||= {:conditions => "positions.company_id =
#{current_user.company_id}"}
end
def scoped_finder_include
@scoped_finder_include ||= {:include => :position}
end
def scoped_o...