This whole thing could be written with something like

```ruby
scopes = %w(post_read post_write ...).select {|scope| u.has_key? scope.to_sym }
```