Fix _profile.html.erb removed is_admin?
This commit is contained in:
parent
42c6abe49e
commit
b49c582c6e
|
@ -23,7 +23,8 @@
|
|||
@filter = {new_filter[:type] => [new_filter[:id].to_s]}
|
||||
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)
|
||||
else
|
||||
@books = Book.where(is_hidden: false, member_profile_id: @member.id).desc(:year).page(params[:page]).per(10)
|
||||
|
|
Loading…
Reference in New Issue