AllowDeleteModelValidationQuery.userFromData constructor
- String key
Allows only document deletion.
If allowWrite
is specified, it takes precedence.
ドキュメントの削除のみを許可します。
allowWrite
が指定されている場合はそちらが優先されます。
An authenticated user whose user ID matches the value of a field with key
in the document to be read or written and the user ID authenticated on the app.
If @uid
is specified, a comparison with the document ID is performed.
If allUsers or authUsers is specified, it takes precedence.
userFromPathIndex can be specified at the same time.
認証済みユーザーのうち、読み込みや書き込み対象のドキュメント中にkey
を持つフィールドの値ととアプリ上で認証しているユーザーIDが一致するユーザー。
@uid
が指定されている場合ドキュメントIDとの比較が行われます。
allUsersやauthUsersが指定されている場合はそちらが優先されます。
userFromPathIndexとは同時に指定可能です。
// Document data
{
"user": "ABCDEFG",
"name": "ABCD",
"age": 20,
}
// Definition
ModelValidationQueryUserType.userFromData("user")
-> 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上でリストが存在している場合、ホワイトリスト形式でパーミッションが指定されます。
permissionやuserを指定して許可をする属性を指定できます。
Implementation
const AllowDeleteModelValidationQuery.userFromData(String key)
: this._(
permission: ModelValidationQueryPermissionType.allowDelete,
user: ModelValidationQueryUserType.userFromData,
key: key,
);