Option to expose only writeable posts for current identity

I would not use a join in a scope, since it adds columns to the result set. Use a subquery instead, this should work:

```ruby
    where('created_by = :id or (id in (
      select post_id
      from locations_posts
      join group_locations gl on gl.location_id = locations_posts.location_id
      join group_memberships gm on gm.group_id = gl.group_id
      where gm.identity_id = :id))', id: identity.id)
```