You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would often be very helpful if it would be possibly to hook into ModelAuthenticatable and ModelTokenAuthenticatable to cause related data to be eager loaded.
One area where this would be very useful would be if a User has a relationship to e.g. Role, which is then used to validate actual access to resources, for instance:
finalclassUser:Model{...@Siblings(through:UserRole.self, from: \.$user, to: \.$role)publicvarroles:[Role]...}finalclassUserRole:Model{...}finalclassRole:Model{...@Siblings(through:UserRole.self, from: \.$role, to: \.$user)publicvarusers:[User]...}
With such a setup one would rather often want to be able to access User.roles to validate access to some resource, but with the current implementation of ModelAuthenticatable and ModelTokenAuthenticatable one has to load User.$roles in each and every instance one wants to check them.
The text was updated successfully, but these errors were encountered:
It would often be very helpful if it would be possibly to hook into
ModelAuthenticatable
andModelTokenAuthenticatable
to cause related data to be eager loaded.One area where this would be very useful would be if a
User
has a relationship to e.g.Role
, which is then used to validate actual access to resources, for instance:With such a setup one would rather often want to be able to access
User.roles
to validate access to some resource, but with the current implementation ofModelAuthenticatable
andModelTokenAuthenticatable
one has to loadUser.$roles
in each and every instance one wants to check them.The text was updated successfully, but these errors were encountered: