I have a Spring Boot application that relies on some quite complex logic to determine whether or not users have permission to perform certain actions. When rendering my templates though, I have to decide whether or not to show certain UI elements based on those permissions, and currently my only way to do that is to pass countless mayUserDo... attributes to the view model.
It would be much easier to instead pass a UserPermissionsService to my model, and perform those simple checks in the template by calling a method from that service, thereby avoiding the mess of having lots of redundant variables floating around.
So my question is: Is this an acceptable solution? If not, why not?