From e80189830d4ceaf2d7c2d77b5749d7fbf91caee0 Mon Sep 17 00:00:00 2001 From: Benedikt Franke Date: Wed, 17 Jun 2020 17:17:13 +0200 Subject: [PATCH] Document clearly that `@can` uses primary keys in `find` (#1437) --- docs/4.0/api-reference/directives.md | 4 ++-- docs/4.1/api-reference/directives.md | 4 ++-- docs/4.10/api-reference/directives.md | 6 ++++-- docs/4.11/api-reference/directives.md | 6 ++++-- docs/4.12/api-reference/directives.md | 6 ++++-- docs/4.13/api-reference/directives.md | 6 ++++-- docs/4.14/api-reference/directives.md | 6 ++++-- docs/4.2/api-reference/directives.md | 4 ++-- docs/4.3/api-reference/directives.md | 4 ++-- docs/4.4/api-reference/directives.md | 4 ++-- docs/4.5/api-reference/directives.md | 4 ++-- docs/4.6/api-reference/directives.md | 4 ++-- docs/4.7/api-reference/directives.md | 4 ++-- docs/4.8/api-reference/directives.md | 4 ++-- docs/4.9/api-reference/directives.md | 6 ++---- docs/master/api-reference/directives.md | 6 ++++-- src/Schema/Directives/CanDirective.php | 6 +++--- 17 files changed, 47 insertions(+), 37 deletions(-) diff --git a/docs/4.0/api-reference/directives.md b/docs/4.0/api-reference/directives.md index 8f0f3ddbeb..540d731eee 100644 --- a/docs/4.0/api-reference/directives.md +++ b/docs/4.0/api-reference/directives.md @@ -447,8 +447,8 @@ directive @can( ability: String! """ - The name of the argument that is used to find a specific model - instance against which the permissions should be checked. + If your policy checks against specific model instances, specify + the name of the field argument that contains its primary key(s). """ find: String diff --git a/docs/4.1/api-reference/directives.md b/docs/4.1/api-reference/directives.md index 8f0ccf13ad..8ffc31dea4 100644 --- a/docs/4.1/api-reference/directives.md +++ b/docs/4.1/api-reference/directives.md @@ -451,8 +451,8 @@ directive @can( ability: String! """ - The name of the argument that is used to find a specific model - instance against which the permissions should be checked. + If your policy checks against specific model instances, specify + the name of the field argument that contains its primary key(s). """ find: String diff --git a/docs/4.10/api-reference/directives.md b/docs/4.10/api-reference/directives.md index cf4168eac1..1069712ede 100644 --- a/docs/4.10/api-reference/directives.md +++ b/docs/4.10/api-reference/directives.md @@ -444,8 +444,10 @@ directive @can( ability: String! """ - The name of the argument that is used to find a specific model - instance against which the permissions should be checked. + If your policy checks against specific model instances, specify + the name of the field argument that contains its primary key(s). + + You may pass the string in dot notation to use nested inputs. """ find: String diff --git a/docs/4.11/api-reference/directives.md b/docs/4.11/api-reference/directives.md index 09518e748e..fe394f2c4d 100644 --- a/docs/4.11/api-reference/directives.md +++ b/docs/4.11/api-reference/directives.md @@ -444,8 +444,10 @@ directive @can( ability: String! """ - The name of the argument that is used to find a specific model - instance against which the permissions should be checked. + If your policy checks against specific model instances, specify + the name of the field argument that contains its primary key(s). + + You may pass the string in dot notation to use nested inputs. """ find: String diff --git a/docs/4.12/api-reference/directives.md b/docs/4.12/api-reference/directives.md index 8a7485ed82..04d6f29bc6 100644 --- a/docs/4.12/api-reference/directives.md +++ b/docs/4.12/api-reference/directives.md @@ -444,8 +444,10 @@ directive @can( ability: String! """ - The name of the argument that is used to find a specific model - instance against which the permissions should be checked. + If your policy checks against specific model instances, specify + the name of the field argument that contains its primary key(s). + + You may pass the string in dot notation to use nested inputs. """ find: String diff --git a/docs/4.13/api-reference/directives.md b/docs/4.13/api-reference/directives.md index fcca44328c..6151612c55 100644 --- a/docs/4.13/api-reference/directives.md +++ b/docs/4.13/api-reference/directives.md @@ -445,8 +445,10 @@ directive @can( ability: String! """ - The name of the argument that is used to find a specific model - instance against which the permissions should be checked. + If your policy checks against specific model instances, specify + the name of the field argument that contains its primary key(s). + + You may pass the string in dot notation to use nested inputs. """ find: String diff --git a/docs/4.14/api-reference/directives.md b/docs/4.14/api-reference/directives.md index fcca44328c..6151612c55 100644 --- a/docs/4.14/api-reference/directives.md +++ b/docs/4.14/api-reference/directives.md @@ -445,8 +445,10 @@ directive @can( ability: String! """ - The name of the argument that is used to find a specific model - instance against which the permissions should be checked. + If your policy checks against specific model instances, specify + the name of the field argument that contains its primary key(s). + + You may pass the string in dot notation to use nested inputs. """ find: String diff --git a/docs/4.2/api-reference/directives.md b/docs/4.2/api-reference/directives.md index c25980fe81..dd6fd19a40 100644 --- a/docs/4.2/api-reference/directives.md +++ b/docs/4.2/api-reference/directives.md @@ -467,8 +467,8 @@ directive @can( ability: String! """ - The name of the argument that is used to find a specific model - instance against which the permissions should be checked. + If your policy checks against specific model instances, specify + the name of the field argument that contains its primary key(s). """ find: String diff --git a/docs/4.3/api-reference/directives.md b/docs/4.3/api-reference/directives.md index 471f2146f7..3468ac9a29 100644 --- a/docs/4.3/api-reference/directives.md +++ b/docs/4.3/api-reference/directives.md @@ -467,8 +467,8 @@ directive @can( ability: String! """ - The name of the argument that is used to find a specific model - instance against which the permissions should be checked. + If your policy checks against specific model instances, specify + the name of the field argument that contains its primary key(s). """ find: String diff --git a/docs/4.4/api-reference/directives.md b/docs/4.4/api-reference/directives.md index cf7db43b31..3be16b4ccb 100644 --- a/docs/4.4/api-reference/directives.md +++ b/docs/4.4/api-reference/directives.md @@ -467,8 +467,8 @@ directive @can( ability: String! """ - The name of the argument that is used to find a specific model - instance against which the permissions should be checked. + If your policy checks against specific model instances, specify + the name of the field argument that contains its primary key(s). """ find: String diff --git a/docs/4.5/api-reference/directives.md b/docs/4.5/api-reference/directives.md index c7f53dfef7..ea7c8a6f8c 100644 --- a/docs/4.5/api-reference/directives.md +++ b/docs/4.5/api-reference/directives.md @@ -467,8 +467,8 @@ directive @can( ability: String! """ - The name of the argument that is used to find a specific model - instance against which the permissions should be checked. + If your policy checks against specific model instances, specify + the name of the field argument that contains its primary key(s). """ find: String diff --git a/docs/4.6/api-reference/directives.md b/docs/4.6/api-reference/directives.md index b151e60b73..e6d41a3946 100644 --- a/docs/4.6/api-reference/directives.md +++ b/docs/4.6/api-reference/directives.md @@ -467,8 +467,8 @@ directive @can( ability: String! """ - The name of the argument that is used to find a specific model - instance against which the permissions should be checked. + If your policy checks against specific model instances, specify + the name of the field argument that contains its primary key(s). """ find: String diff --git a/docs/4.7/api-reference/directives.md b/docs/4.7/api-reference/directives.md index 81d6d4ea46..97d056f3b5 100644 --- a/docs/4.7/api-reference/directives.md +++ b/docs/4.7/api-reference/directives.md @@ -470,8 +470,8 @@ directive @can( ability: String! """ - The name of the argument that is used to find a specific model - instance against which the permissions should be checked. + If your policy checks against specific model instances, specify + the name of the field argument that contains its primary key(s). """ find: String diff --git a/docs/4.8/api-reference/directives.md b/docs/4.8/api-reference/directives.md index 594fdce56c..498f2854ee 100644 --- a/docs/4.8/api-reference/directives.md +++ b/docs/4.8/api-reference/directives.md @@ -470,8 +470,8 @@ directive @can( ability: String! """ - The name of the argument that is used to find a specific model - instance against which the permissions should be checked. + If your policy checks against specific model instances, specify + the name of the field argument that contains its primary key(s). """ find: String diff --git a/docs/4.9/api-reference/directives.md b/docs/4.9/api-reference/directives.md index 1bc1ceb254..893f6a6012 100644 --- a/docs/4.9/api-reference/directives.md +++ b/docs/4.9/api-reference/directives.md @@ -450,10 +450,8 @@ directive @can( ability: String! """ - The name of the argument that is used to find a specific model - instance against which the permissions should be checked. - - You may pass the string as a dot notation to search in a array. + If your policy checks against specific model instances, specify + the name of the field argument that contains its primary key(s). """ find: String diff --git a/docs/master/api-reference/directives.md b/docs/master/api-reference/directives.md index 0a0d16a973..dea6982029 100644 --- a/docs/master/api-reference/directives.md +++ b/docs/master/api-reference/directives.md @@ -445,8 +445,10 @@ directive @can( ability: String! """ - The name of the argument that is used to find a specific model - instance against which the permissions should be checked. + If your policy checks against specific model instances, specify + the name of the field argument that contains its primary key(s). + + You may pass the string in dot notation to use nested inputs. """ find: String diff --git a/src/Schema/Directives/CanDirective.php b/src/Schema/Directives/CanDirective.php index 8a809245ed..6c6924bc07 100644 --- a/src/Schema/Directives/CanDirective.php +++ b/src/Schema/Directives/CanDirective.php @@ -48,10 +48,10 @@ public static function definition(): string ability: String! """ - The name of the argument that is used to find a specific model - instance against which the permissions should be checked. + If your policy checks against specific model instances, specify + the name of the field argument that contains its primary key(s). - You may pass the string as a dot notation to search in a array. + You may pass the string in dot notation to use nested inputs. """ find: String