Class UserProfileMetaDataProvider

java.lang.Object
com.kingsrook.qqq.backend.core.actions.profile.UserProfileMetaDataProvider

public class UserProfileMetaDataProvider extends Object
Installs the core user profile: the user_profile table, the "profile" preferences section (photo, display name, optional Gravatar) and the UserProfilesMetaData settings. Applications supply the table's migration and a storage (S3/filesystem) table for the avatar images; see docs/USER-PROFILE-AVATARS.md.
  • Constructor Details

    • UserProfileMetaDataProvider

      public UserProfileMetaDataProvider()
  • Method Details

    • defineAll

      public void defineAll(QInstance qInstance, String backendName, String avatarStorageTableName)
      Define everything, with the default table name (user_profile).
    • defineAll

      public void defineAll(QInstance qInstance, String backendName, String avatarStorageTableName, String tableNameOrNull)
      Define everything, with a table name of the application's choosing.
    • defineTable

      public QTableMetaData defineTable(String tableName, String backendName)
      The audited profile table (one row per user; no foreign keys). Protected: table permissions (user_profile.read ...), and each row is locked to its owner (user_profile_user key; user_profile_admin sees all), so through the standard table APIs a user reaches only their own row. Users change their row through the Profile preferences section (no table permission needed).
    • defineSection

      public UserPreferenceSectionMetaData defineSection()
      The "profile" preferences section.
    • withGravatarOptIn

      public UserProfileMetaDataProvider withGravatarOptIn(boolean gravatarOptIn)
      Fluent setter for gravatarOptIn (default false).
    • withMaxAvatarBytes

      public UserProfileMetaDataProvider withMaxAvatarBytes(long maxAvatarBytes)
      Fluent setter for maxAvatarBytes (default 5 MB).
    • withTableCustomizer

      public UserProfileMetaDataProvider withTableCustomizer(Consumer<QTableMetaData> tableCustomizer)
      Fluent setter for a customizer of the table (e.g. snake_case backend names).