You could as you said create a relation between User
and Service
(1 -> M) making it easier to run a query for the Service
objects for that User
. My thinking of this is that it sounds like it fits within your domain model, after all, it sounds like there is a real relationship between the User
and the Service
as the Service
does in fact belong to the User
. Permissions are still helpful for controlling who has access to the Service
whilst that one User
remains the owner of the Service
[services: Service.findAllByUser(User.findByUsername(SecurityUtils.subject.principal))]
It might not make it any more efficient but it is a cleaner solution