Class UserProfiles
java.lang.Object
com.kingsrook.qqq.backend.core.actions.profile.UserProfiles
Read side and security of the core user profile: a user's row, their avatar
(addressed by an opaque avatarId, never by user id or email) and its storage
objects, the record-lock keys for sessions, and the values a session sends to
its frontend. Lookups of other users run as the system (avatars are visible
to every signed-in user); the write side is UserProfilePreferenceProvider,
for the signed-in user only.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordWhat GET /avatars serves for an avatarId: the user's photo (avatarKey), or their chosen Gravatar (fetched and re-encoded by the server, so neither the email hash nor the viewer reaches Gravatar's URL from a browser). -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic voidapplyIfInstalled(QInstance qInstance, QSession session) Stamp the keys on a session the framework just finalized (each UI API request, each automated session for jobs, schedules and deliveries), when the instance installs profiles.static voidapplyToSession(QSession session) Give a session its profile record-lock keys: user_profile_user = its user id, and the all-access key when it holds user_profile_admin.static StorageInputavatarObject(String avatarKey, int size) The storage object of one size of an avatar.static UserProfiles.AvatarThe avatar a profile row shows, or null for none (initials).static StringavatarUrl(UserProfiles.Avatar avatar) The relative URL of an avatar (add size=32|64|128|256).static voidensureSessionKeys(QSession session) Apply the keys only when the session has none yet.static QRecordA user's profile row, or null (also null when profiles aren't installed).static QRecordfindByAvatarId(String avatarId) The profile row with an avatarId, or null.static Map<String, Serializable> frontendUserValues(QInstance qInstance, QSession session) The profile values a session sends its frontend under values.user: avatarUrl (when the user has a photo or Gravatar) and displayName (when set).lookup(Collection<String> userIds) Avatar URLs of up to MAX_LOOKUP_USER_IDS users; users without one are left out (clients draw their initials).static UserProfilesMetaDatasettings()The installed profile settings, or null.
-
Field Details
-
AVATAR_PATH
- See Also:
-
-
Method Details
-
settings
The installed profile settings, or null. -
applyToSession
Give a session its profile record-lock keys: user_profile_user = its user id, and the all-access key when it holds user_profile_admin. Hosts call this when they build sessions (as for durable jobs); the profile provider also ensures it before writing. No-op for null and system sessions. -
applyIfInstalled
Stamp the keys on a session the framework just finalized (each UI API request, each automated session for jobs, schedules and deliveries), when the instance installs profiles. Additive only (a cached session shared by concurrent requests never loses its keys midway). Never throws. -
ensureSessionKeys
Apply the keys only when the session has none yet. -
find
A user's profile row, or null (also null when profiles aren't installed).- Throws:
QException
-
findByAvatarId
The profile row with an avatarId, or null.- Throws:
QException
-
lookup
Avatar URLs of up to MAX_LOOKUP_USER_IDS users; users without one are left out (clients draw their initials).- Throws:
QException
-
avatarOf
The avatar a profile row shows, or null for none (initials). -
avatarUrl
The relative URL of an avatar (add size=32|64|128|256). -
avatarObject
The storage object of one size of an avatar. -
frontendUserValues
The profile values a session sends its frontend under values.user: avatarUrl (when the user has a photo or Gravatar) and displayName (when set). Empty when profiles aren't installed. Never throws: a profile lookup must not break signing in.
-