This PR splits off the memberships and permssions from the user object to their own properties of the session object. The user object no longer has permissions or memberships as properties. This means that getUser and useUser returns permissions and memberships on the same level as the user object. The new usage looks like this:
Permissions and memberships are always returned as arrays, even if there is no user. If there is no user the permissions array will include the default permissions while the memebrships array will be empty. This is so that one can always safely do permissions.includes().
This PR splits off the memberships and permssions from the user object to their own properties of the session object. The user object no longer has permissions or memberships as properties. This means that
getUser
anduseUser
returns permissions and memberships on the same level as theuser
object. The new usage looks like this:Permissions and memberships are always returned as arrays, even if there is no user. If there is no user the permissions array will include the default permissions while the memebrships array will be empty. This is so that one can always safely do
permissions.includes()
.