Fix _profile.html.erb removed is_admin?

This commit is contained in:
manson 2014-07-15 16:02:52 +08:00
parent 42c6abe49e
commit b49c582c6e
1 changed files with 2 additions and 1 deletions

View File

@ -23,7 +23,8 @@
@filter = {new_filter[:type] => [new_filter[:id].to_s]} @filter = {new_filter[:type] => [new_filter[:id].to_s]}
end end
if @member && @member.user.is_admin? is_autorized_user = (current_user==@member.user || current_user.is_admin?)
if is_autorized_user
@books = Book.where(member_profile_id: @member.id).desc(:year).page(params[:page]).per(10) @books = Book.where(member_profile_id: @member.id).desc(:year).page(params[:page]).per(10)
else else
@books = Book.where(is_hidden: false, member_profile_id: @member.id).desc(:year).page(params[:page]).per(10) @books = Book.where(is_hidden: false, member_profile_id: @member.id).desc(:year).page(params[:page]).per(10)