Skip to content

Commit 6d9374a

Browse files
authored
Merge pull request #2654 from mooreds/mooreds/correct-bundle-docs
docs(bundles): corrected grammar and JSON issues in Bundle docs, and updated the example for consistency
2 parents 91f03ab + 3220510 commit 6d9374a

File tree

1 file changed

+31
-31
lines changed

1 file changed

+31
-31
lines changed

docs/operations/bundle.mdx

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -3,50 +3,52 @@ icon: cube
33
title: Data Bundles
44
---
55

6-
## What is Data Bundles
6+
## What are Data Bundles
77

88
Ensuring that authorization data remains in sync with the business model is an important practice when using Permify.
99

1010
Prior to Data Bundles, it was the responsibility of the services (such as [WriteData](../api-reference/data/write-data) API) to structure how relations are created and deleted when actions occur on resources.
1111

12-
With the Data Bundles, you be able to bundle and model the creation and deletion of relations and attributes when specific actions occur on resources in your applications.
12+
With the Data Bundles, you can model the creation and deletion of relations and attributes when specific actions occur on resources in your applications.
1313

14-
We believe this functionality will streamline managing authorization data as well as managing this in a central place increase visibility around certain actions/triggers that end up with data creation.
14+
This functionality streamlines managing authorization data, allows you to manage it in a central place, and increases visibility around certain actions/triggers that create data.
1515

16-
## How Bundles Works
16+
## How Bundles Work
1717

18-
Let's examine how Bundles operates with basic example.
18+
Let's examine how Bundles operate.
1919

20-
Let's say you want to model how data will be created when an organization created in your application. For this purpose, you can utilize the [WriteBundle](../../api-reference/bundle/write-bundle) API endpoint. This API enables users to define or update data bundles, each distinguished by a unique name.
20+
Let's say you want to model how data will be created when an organization is created in your application. For this purpose, you can utilize the [WriteBundle](../../api-reference/bundle/write-bundle) API endpoint. This API enables users to define or update data bundles, each distinguished by a unique name.
2121

2222
Here's an example body for WriteBundle in this scenario:
2323

2424
```json
25-
"bundles": [
26-
{
27-
"name": "organization_created"
28-
"arguments": [
29-
"creatorID",
30-
"organizationID"
31-
],
32-
"operations": [
33-
{
34-
"relationships_write": [
35-
"organization:{{.organizationID}}#admin@user:{{.creatorID}}",
36-
"organization:{{.organizationID}}#manager@user:{{.creatorID}}",
37-
],
38-
"attributes_write": [
39-
"organization:{{.organizationID}}$public|boolean:false",
40-
],
41-
},
42-
],
43-
},
44-
],
25+
{
26+
"bundles": [
27+
{
28+
"name": "organization_created",
29+
"arguments": [
30+
"creatorID",
31+
"organizationID"
32+
],
33+
"operations": [
34+
{
35+
"relationships_write": [
36+
"organization:{{.organizationID}}#admin@user:{{.creatorID}}",
37+
"organization:{{.organizationID}}#manager@user:{{.creatorID}}"
38+
],
39+
"attributes_write": [
40+
"organization:{{.organizationID}}$public|boolean:false"
41+
]
42+
}
43+
]
44+
}
45+
]
46+
}
4547
```
4648

4749
Operations represent actions that can be performed on relationships and attributes, such as adding or deleting relationships when certain events occur.
4850

49-
Let's say user:564 creates an organization:789 in your application. According to your authorization logic, this will result in the creation of several authorization data, including relational tuples and attributes, respectively.
51+
Let's say user:564 creates an organization:789 in your application. According to your authorization logic, this will result in the creation of several pieces of authorization data, including relational tuples and attributes:
5052

5153
- organization:789#admin@user:564
5254
- organization:789#manager@user:564
@@ -57,13 +59,11 @@ Instead of using the [WriteData](../../api-reference/data/write-data) endpoint,
5759
An example request of [RunBundle](../../api-reference/data/run-bundle) for this scenario:
5860

5961
```json
60-
POST /bundle
61-
BODY
6262
{
63-
"name": "project_created",
63+
"name": "organization_created",
6464
"arguments": {
6565
"creatorID": "564",
66-
"organizationID": "789",
66+
"organizationID": "789"
6767
}
6868
}
6969
```

0 commit comments

Comments
 (0)