title: Google Classroom API: Courses list returning unavailable classes
body: <p>I am trying to fetch a list of classes which the current user has access to, and I am getting classes returned which the user cannot access.</p>
  
  <p>Using the ruby client I can call</p>
  
  <pre class="lang-rb prettyprint-override"><code>service.list_courses(course_states: "ACTIVE")
  # I have 7 courses returned
  </code></pre>
  
  <p>OR</p>
  
  <pre class="lang-rb prettyprint-override"><code>service.list_courses(course_states: "ACTIVE", teacher_id: "me")
  # I have 3 courses returned (just mine)
  </code></pre>
  
  <p>The issue is that in the first call there are 4 courses returned <em>which the current user cannot see/access</em>. This seems like it <em>shouldn't be happening</em> as <a href="https://developers.google.com/classroom/reference/rest/v1/courses/list" rel="nofollow noreferrer">the docs</a> say <code>Returns a list of courses that the requesting user is permitted to view, restricted to those that match the request.</code></p>
  
  <p>Is this a <em>bug</em> which I should report <a href="https://issuetracker.google.com/issues?q=status:open%20componentid:191645%2B%20type:bug" rel="nofollow noreferrer">in the issue tracker</a> or am I misunderstanding what results can be returned in the courses list?</p>
  
  <p>My use case is that I want to create a <code>course work</code> item in a course, but I only want to do this for courses that the teacher can access. I thought that the <code>list courses</code> should return exactly that list, but, it doesn't seem to (unless I specify <code>teacher_id: "me"</code>, but then I'm worried I'll miss courses which the teacher is collaborating on (if that's even possible))</p>
  
  <p>Is this a bug or am I misunderstanding something?</p>
  
  <h2>Edited to add</h2>
  
  <p>Thanks to @ziganotschka for the API details. After further testing, calling <code>service.list_courses(course_states: "ACTIVE", teacher_id: "me")</code> will return courses that the requesting user has created <em>or</em> courses that the requesting user is  collaborating on. This wasn't obvious to me as the <a href="https://developers.google.com/classroom/reference/rest/v1/courses#Course" rel="nofollow noreferrer">course object</a> has an <code>owner_id</code> field which is a single user, so, I thought the <code>teacher_id</code> might be referencing that.</p>
  
  <p>The issue I had been running into was that I was logged in as the <code>super admin</code> which according to the answer below <em>allows me to see all the courses</em>. However, I wasn't actually able to access the weblink of any of those courses which is what was confusing me.</p>