From 0f67733fa855e9e6b1ea85141e3aab3009777367 Mon Sep 17 00:00:00 2001 From: Daniel Cousens <413395+dcousens@users.noreply.github.com> Date: Fri, 8 Sep 2023 09:58:29 +1000 Subject: [PATCH 1/3] reword sudo to remove ambiguitiy --- docs/pages/docs/context/overview.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/pages/docs/context/overview.md b/docs/pages/docs/context/overview.md index a2e8bc4a12b..53ffb4cd0cf 100644 --- a/docs/pages/docs/context/overview.md +++ b/docs/pages/docs/context/overview.md @@ -101,7 +101,7 @@ See the [session API](../config/session#session-context) for more details. When using the `context.query`, `context.graphql.run`, and `context.graphql.raw` APIs, access control and session information is passed through to these calls from the `context` object. The following functions will create a new `Context` object with this behaviour modified. -`sudo()`: A function which returns a new elevated `Context` object with all access control disabled and all filters enabled for subsequent API calls. +`sudo()`: A function which returns an elevated `Context` object with any access control limitations removed, bypassing your `access` configuration. `withRequest(req, res)`: A function which returns a new user `Context` object with a session and access control based on the `req` given. From 9cf09c7860436b9425e64e4f262a9d93dbbb7b4d Mon Sep 17 00:00:00 2001 From: Daniel Cousens <413395+dcousens@users.noreply.github.com> Date: Fri, 8 Sep 2023 10:04:38 +1000 Subject: [PATCH 2/3] align language, and update withRequest explanation --- docs/pages/docs/context/overview.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/pages/docs/context/overview.md b/docs/pages/docs/context/overview.md index 53ffb4cd0cf..dae47bd452f 100644 --- a/docs/pages/docs/context/overview.md +++ b/docs/pages/docs/context/overview.md @@ -101,11 +101,11 @@ See the [session API](../config/session#session-context) for more details. When using the `context.query`, `context.graphql.run`, and `context.graphql.raw` APIs, access control and session information is passed through to these calls from the `context` object. The following functions will create a new `Context` object with this behaviour modified. -`sudo()`: A function which returns an elevated `Context` object with any access control limitations removed, bypassing your `access` configuration. +`sudo()`: A function which returns a new `Context` object with access control limitations removed, bypassing your `access` control configuration. -`withRequest(req, res)`: A function which returns a new user `Context` object with a session and access control based on the `req` given. +`withRequest(req, res)`: A function which returns a new `Context` object with the `.session` determined by your `sessionStrategy.get` function. -`withSession(newSession)`: A function which returns a new `Context` object with the `.session` object replaced with `newSession`. +`withSession(newSession)`: A function which returns a new `Context` object with the `.session` object replaced with the `newSession` argument. ### Database access From 863c9cef04768a694f61b44c8c0dc56836389cdd Mon Sep 17 00:00:00 2001 From: Daniel Cousens <413395+dcousens@users.noreply.github.com> Date: Fri, 8 Sep 2023 10:05:06 +1000 Subject: [PATCH 3/3] s/with/by --- docs/pages/docs/context/overview.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/pages/docs/context/overview.md b/docs/pages/docs/context/overview.md index dae47bd452f..a8684768231 100644 --- a/docs/pages/docs/context/overview.md +++ b/docs/pages/docs/context/overview.md @@ -105,7 +105,7 @@ The following functions will create a new `Context` object with this behaviour m `withRequest(req, res)`: A function which returns a new `Context` object with the `.session` determined by your `sessionStrategy.get` function. -`withSession(newSession)`: A function which returns a new `Context` object with the `.session` object replaced with the `newSession` argument. +`withSession(newSession)`: A function which returns a new `Context` object with the `.session` object replaced by the `newSession` argument. ### Database access