Skip to content

Commit 973fa37

Browse files
authored
Merge pull request #230 from moufmouf/fix_fine_grained_doc
Better example in fine-grained documentation
2 parents f5ebccd + 74637b0 commit 973fa37

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

docs/fine-grained-security.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,15 +151,15 @@ You can use the `this` variable to access any (public) property / method of the
151151
```php
152152
class Post {
153153
/**
154-
* @Query
155-
* @Security("this.canAccess(post, user)")
154+
* @Field
155+
* @Security("this.canAccessBody(user)")
156156
*/
157-
public function getPost(Post $post): array
157+
public function getBody(): array
158158
{
159159
// ...
160160
}
161161

162-
public function canAccess(Post $post, User $user): bool
162+
public function canAccessBody(User $user): bool
163163
{
164164
// Some custom logic here
165165
}

website/versioned_docs/version-4.0/fine-grained-security.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,15 +152,15 @@ You can use the `this` variable to access any (public) property / method of the
152152
```php
153153
class Post {
154154
/**
155-
* @Query
156-
* @Security("this.canAccess(post, user)")
155+
* @Field
156+
* @Security("this.canAccessBody(user)")
157157
*/
158-
public function getPost(Post $post): array
158+
public function getBody(): array
159159
{
160160
// ...
161161
}
162162

163-
public function canAccess(Post $post, User $user): bool
163+
public function canAccessBody(User $user): bool
164164
{
165165
// Some custom logic here
166166
}

0 commit comments

Comments
 (0)