diff --git a/app/controllers/albums_controller.rb b/app/controllers/albums_controller.rb index dd7c417e3cf5dc8ee4af4080ac79aa5d0f6b36d2..c946f7508e6f2ede5194e5cf887186e7a8e01912 100644 --- a/app/controllers/albums_controller.rb +++ b/app/controllers/albums_controller.rb @@ -34,6 +34,7 @@ class AlbumsController < ApplicationController def edit @album = Album.find_by_id params[:id] + redirect_to @album unless current_user.owns? @album end def update diff --git a/app/controllers/photos_controller.rb b/app/controllers/photos_controller.rb index 3c0fe4b4e4276ca7d2ca1d8ea9e446108d503ac0..b684c986d9428a23a7741319d46e75e646897da1 100644 --- a/app/controllers/photos_controller.rb +++ b/app/controllers/photos_controller.rb @@ -71,6 +71,8 @@ class PhotosController < ApplicationController def edit @photo = Photo.find_by_id params[:id] @album = @photo.album + + redirect_to @photo unless current_user.owns? @album end def update diff --git a/app/views/aspects/show.html.haml b/app/views/aspects/show.html.haml index 5925354f0e530cfc96285b1c0ecaa9973d24c78f..aea12cfe5a6126c95e58b965b86b378ecbcbc18f 100644 --- a/app/views/aspects/show.html.haml +++ b/app/views/aspects/show.html.haml @@ -6,7 +6,7 @@ %ul#stream - for post in @posts - = render type_partial(post), :post => post + = render type_partial(post), :post => post unless post.class == Album #pagination = will_paginate @posts diff --git a/app/views/photos/show.html.haml b/app/views/photos/show.html.haml index cbe3505f949e069f987f538b3e156d46e728a2f0..37ccdcc9e43331b5185c6798097db2d379bf5532 100644 --- a/app/views/photos/show.html.haml +++ b/app/views/photos/show.html.haml @@ -21,7 +21,8 @@ = @photo.image .right - = link_to 'Edit Photo', edit_photo_path(@photo), :class => "button" + -if current_user.owns? @album + = link_to 'Edit Photo', edit_photo_path(@photo), :class => "button" .sub_header = link_to "<< prev", url_to_prev(@photo, @album)