``` ruby
 groups = (current_user.admin? ? Group.scoped : current_user.owned_groups)
```
https://github.com/gitlabhq/gitlabhq/blob/master/app/models/user.rb#L77