app/controllers/effective/pages_controller.rb in effective_pages-1.0.2 vs app/controllers/effective/pages_controller.rb in effective_pages-1.0.3
- old
+ new
@@ -3,10 +3,10 @@
def show
@pages = (Rails::VERSION::MAJOR > 3 ? Effective::Page.all : Effective::Page.scoped)
@pages = @pages.published if params[:edit].to_s != 'true'
@page = @pages.find(params[:id])
- raise Effective::AccessDenied unless @page.roles_permit?(current_user)
+ raise Effective::AccessDenied unless (@page.present? && @page.roles_permit?(current_user))
EffectivePages.authorized?(self, :show, @page)
@page_title = @page.title