@weaviate
    Preparing search index...

    Interface DBUsers

    Operations supported for namespaced 'db' users.

    interface DBUsers {
        activate: (userId: string) => Promise<boolean>;
        assignRoles: (
            roleNames: string | string[],
            userId: string,
        ) => Promise<void>;
        byName: (userId: string, opts?: GetUserOptions) => Promise<UserDB>;
        create: (userId: string) => Promise<string>;
        deactivate: (userId: string, opts?: DeactivateOptions) => Promise<boolean>;
        delete: (userId: string) => Promise<boolean>;
        getAssignedRoles: (
            userId: string,
            opts?: GetAssignedRolesOptions,
        ) => Promise<Record<string, Role>>;
        listAll: (opts?: GetUserOptions) => Promise<UserDB[]>;
        revokeRoles: (
            roleNames: string | string[],
            userId: string,
        ) => Promise<void>;
        rotateKey: (userId: string) => Promise<string>;
    }

    Hierarchy (View Summary)

    Index
    activate: (userId: string) => Promise<boolean>

    Activate 'db_user' user.

    Type Declaration

      • (userId: string): Promise<boolean>
      • Parameters

        • userId: string

          The ID of the user to activate.

        Returns Promise<boolean>

        true if the user has been successfully activated.

    assignRoles: (roleNames: string | string[], userId: string) => Promise<void>

    Assign roles to a user.

    Type Declaration

      • (roleNames: string | string[], userId: string): Promise<void>
      • Parameters

        • roleNames: string | string[]

          The name or names of the roles to assign.

        • userId: string

          The ID of the user to assign the roles to.

        Returns Promise<void>

        A promise that resolves when the roles are assigned.

    byName: (userId: string, opts?: GetUserOptions) => Promise<UserDB>

    Retrieve information about the 'db_user' / 'db_env_user' user.

    Type Declaration

      • (userId: string, opts?: GetUserOptions): Promise<UserDB>
      • Parameters

        • userId: string

          The ID of the user to get.

        • Optionalopts: GetUserOptions

        Returns Promise<UserDB>

        ID, status, and assigned roles of a 'db_*' user.

    create: (userId: string) => Promise<string>

    Create a new 'db_user' user.

    Type Declaration

      • (userId: string): Promise<string>
      • Parameters

        • userId: string

          The ID of the user to create. Must consist of valid URL characters only.

        Returns Promise<string>

        API key for the newly created user.

    deactivate: (userId: string, opts?: DeactivateOptions) => Promise<boolean>

    Deactivate 'db_user' user.

    Type Declaration

      • (userId: string, opts?: DeactivateOptions): Promise<boolean>
      • Parameters

        Returns Promise<boolean>

        true if the user has been successfully deactivated.

    delete: (userId: string) => Promise<boolean>

    Delete a 'db_user' user. It is not possible to delete 'db_env_user' users programmatically.

    Type Declaration

      • (userId: string): Promise<boolean>
      • Parameters

        • userId: string

          The ID of the user to delete.

        Returns Promise<boolean>

        true if the user has been successfully deleted.

    getAssignedRoles: (
        userId: string,
        opts?: GetAssignedRolesOptions,
    ) => Promise<Record<string, Role>>

    Retrieve the roles assigned to a 'db_user' user.

    Type Declaration

      • (userId: string, opts?: GetAssignedRolesOptions): Promise<Record<string, Role>>
      • Parameters

        Returns Promise<Record<string, Role>>

        A map of role names to their respective roles.

    listAll: (opts?: GetUserOptions) => Promise<UserDB[]>

    List all 'db_user' / 'db_env_user' users.

    Type Declaration

    revokeRoles: (roleNames: string | string[], userId: string) => Promise<void>

    Revoke roles from a user.

    Type Declaration

      • (roleNames: string | string[], userId: string): Promise<void>
      • Parameters

        • roleNames: string | string[]

          The name or names of the roles to revoke.

        • userId: string

          The ID of the user to revoke the roles from.

        Returns Promise<void>

        A promise that resolves when the roles are revoked.

    rotateKey: (userId: string) => Promise<string>

    Rotate the API key of a 'db_user' user. The old API key becomes invalid. API keys of 'db_env_user' users are defined in the server's environment and cannot be modified programmatically.

    Type Declaration

      • (userId: string): Promise<string>
      • Parameters

        • userId: string

          The ID of the user to create a new API key for.

        Returns Promise<string>

        New API key for the user.