Skip to content

Commit a072e21

Browse files
hdworld11ashika112
andauthored
improve callout for group access in storage (#7973)
* improve callout for group access in storage * Update table header to fix test --------- Co-authored-by: ashika112 <155593080+ashika112@users.noreply.github.com>
1 parent 24fc529 commit a072e21

File tree

1 file changed

+14
-8
lines changed
  • src/pages/[platform]/build-a-backend/storage/authorization

1 file changed

+14
-8
lines changed

src/pages/[platform]/build-a-backend/storage/authorization/index.mdx

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ Refer to the following examples to understand how you can further customize auth
3636

3737
## Access Types
3838

39+
Authentication is required to continue using Amplify Storage, please make sure you set it up if you haven't already - [documentation to set up Auth](/[platform]/build-a-backend/auth/set-up-auth/).
40+
3941
<Callout>
4042

4143
**Note:** Paths in access definitions cannot have a '/' at the beginning of the string.
@@ -44,15 +46,10 @@ By default, all paths are denied to all types of users unless explicitly granted
4446

4547
</Callout>
4648

47-
Authentication is required to continue using Amplify Storage, please make sure you set it up if you haven't already - [documentation to set up Auth](/[platform]/build-a-backend/auth/set-up-auth/).
48-
4949
<BlockSwitcher>
5050
<Block name="Guest Users">
51-
{/* it's not actually files that are like /media/*hey right? so instead it should be all files that are under the media/ */}
5251
To grant all guest (i.e. not signed in) users of your application read access to files under `media/`, use the following `access` values.
5352

54-
{/* I would flip this guide to have the conceptual first so you don't need explanations like the ones in the comments */}
55-
5653
```ts title="amplify/storage/resource.ts"
5754
export const storage = defineStorage({
5855
name: 'myProjectFiles',
@@ -66,6 +63,14 @@ export const storage = defineStorage({
6663

6764
</Block>
6865
<Block name="Authenticated Users">
66+
<Callout>
67+
68+
**Note:** When a user is part of a group, they are assigned the group role, which means permissions defined for the authenticated role will not apply for this user.
69+
70+
To grant access to users within a group, you must explicitly define access permissions for the group against the desired prefix.
71+
72+
</Callout>
73+
6974
To grant all authenticated (i.e. signed in) users of your application read access to files under `media/`, use the following `access` configuration.
7075

7176
```ts title="amplify/storage/resource.ts"
@@ -78,13 +83,14 @@ export const storage = defineStorage({
7883
})
7984
});
8085
```
81-
8286
</Block>
8387
<Block name="User Groups">
8488

8589
<Callout>
8690

87-
**Note:** When a user is part of a group that has access rules defined in the `amplify/storage/resource.ts` file, those group-specific access rules will take priority over any general access rules set for authenticated users.
91+
**Note:** When a user is part of a group, they are assigned the group role, which means permissions defined for the authenticated role will not apply for this user.
92+
93+
To grant access to users within a group, you must explicitly define access permissions for the group against the desired prefix.
8894

8995
</Callout>
9096

@@ -227,7 +233,7 @@ export const storage = defineStorage({
227233

228234
The access control matrix for this configuration is
229235

230-
| | media/\* | media/profile-pictures/\* | media/albums/\* | other/\* |
236+
| Path | media/\* | media/profile-pictures/\* | media/albums/\* | other/\* |
231237
| --- | --- | --- | --- | --- |
232238
| **Authenticated Users** | read, write, delete | NONE | read | read, write |
233239
| **Guest users** | NONE | read | NONE | read |

0 commit comments

Comments
 (0)