title: View link if depended on user rights
body: <p>I am working with CakePhp 2.x. I have three Columns:</p>
  
  <p>User | Course | UserCourseRole</p>
  
  <p>Each user can edit multiple courses and one course can be edited by multiple users. So far so good.</p>
  
  <p>If a user wants to see an index of all the courses <strong>i want to show a 'edit'-link only next to the courses which he can in fact edit.</strong> 
  How can i realize this? I figured i would have to set some sort of extra field inside the CourseController and check for this field inside the view. Is this the right way to go?</p>
  
  <p>My current Code is</p>
  
  <p>CourseController.php</p>
  
  <pre><code>...
  public function index() {
          $courses = $this-&gt;Course-&gt;find('all', array('recursive' =&gt; 2));
  
           $this-&gt;set('courses', $courses);
      }
  ...
  </code></pre>
  
  <p>Courses/index.ctp</p>
  
  <pre><code>&lt;!-- File: /app/View/Courses/index.ctp --&gt;
  ...
  &lt;?php foreach ($courses as $course):?&gt;
      ...
      &lt;?php 
          echo $this-&gt;Html-&gt;link('edit', array('action' =&gt; 'edit', $course['Course']['id']));     
     ?&gt;
     ...
  </code></pre>