Fixes #5503/BZ1102315 - restrict UI interactions to actual permissions.

http://projects.theforeman.org/issues/5503
https://bugzilla.redhat.com/show_bug.cgi?id=1102315
If you call `flatten` you can reduce the complexity of the data structure down to a single array of objects. 

```
current_user.roles.collect { |role| role.permissions }.flatten.to_json
```