AllowUpdateModelValidationQuery.userFromPathIndex constructor

const AllowUpdateModelValidationQuery.userFromPathIndex(
  1. int key
)

Allows only document updates.

If allowWrite is specified, it takes precedence.

ドキュメントの更新のみを許可します。

allowWriteが指定されている場合はそちらが優先されます。

An authenticated user whose user ID matches the dynamic value specified by the index number in the document or collection path and the user ID authenticated on the app.

You can specify odd numbers such as 1 or 3 even if you specify a collection since it will always be compared to a document.

If allUsers or authUsers is specified, it takes precedence.

userFromData can be specified at the same time.

認証済みユーザーのうち、ドキュメントやコレクションのパス中のインデックス番号で指定する動的な値とアプリ上で認証しているユーザーIDが一致するユーザー。

必ずドキュメントとの比較になるのでコレクションを指定した場合でも13などの奇数番号を指定可能です。

allUsersauthUsersが指定されている場合はそちらが優先されます。

userFromDataとは同時に指定可能です。

// Path definition
/collection/:document_id
// Actual path
/collection/ABCDEFG
// Definition
ModelValidationQueryUserType.userFromPathIndex(1)
-> Allow users whose user ID is `ABCDEFG

Define the validation query to be used by DatabaseValidator.

Basically, if a listing exists on ModelQuery, permissions are specified in a white list format.

You can specify attributes to allow by specifying permission or user.

DatabaseValidatorで使用するバリデーションクエリを定義します。

基本的にはModelQuery上でリストが存在している場合、ホワイトリスト形式でパーミッションが指定されます。

permissionuserを指定して許可をする属性を指定できます。

Implementation

const AllowUpdateModelValidationQuery.userFromPathIndex(int key)
    : this._(
        permission: ModelValidationQueryPermissionType.allowUpdate,
        user: ModelValidationQueryUserType.userFromPathIndex,
        key: key,
      );