Skip to content

Commit

Permalink
Added a check for Auth component and then allowed view method
Browse files Browse the repository at this point in the history
  • Loading branch information
bbelyeu committed May 17, 2012
1 parent 49d944c commit adf0c85
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Controller/ImagesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,19 @@ public function view($id = null)
$this->set('image', $this->Image->read(null, $id));
}

/**
* If auth component is turned on allow index & view without authorization
*
* @return null
*/
public function beforeFilter()
{
if (!empty($this->Auth)) {
$this->Auth->allow('view');
}
parent::beforeFilter();
}

/**
* admin_index method
*
Expand Down

0 comments on commit adf0c85

Please sign in to comment.