Skip to content

Commit 2399bec

Browse files
authored
Feat/rpq revisions (#818)
1 parent aa56df4 commit 2399bec

File tree

4 files changed

+120
-130
lines changed

4 files changed

+120
-130
lines changed

docs/content/interacting/managing-group-access.mdx

+21-22
Original file line numberDiff line numberDiff line change
@@ -21,32 +21,31 @@ import {
2121

2222
<DocumentationNotice />
2323

24-
In this guide you will learn how to grant a group of users access to a particular object.
24+
<ProductName format={ProductNameFormat.ShortForm}/> allows you to grant a group of users access to a particular object.
2525

2626
<CardBox title="When to use" appearance="filled">
2727

28-
Adding a relationship tuple specifying that a group has a relation to an object is helpful in cases where you want to encompass a set of users with the same relation to an object. For example:
28+
Relationship tuples are helpful when you want to specify that a group of users all have the same relation to an object. For example, <ProductName format={ProductNameFormat.ShortForm}/> allows you to:
2929

3030
- Grant a group of `engineers` `viewer` access to `roadmap.doc`
3131
- Create a `block_list` of `members` who can't access a `document`
32-
- Sharing a `document` with a `team`
33-
- Granting `viewer` access to a `photo` to `followers` only
34-
- Making a `file` viewable for all `users` within an `organization`
35-
- Restricting access from or to `users` in a certain `locale`
32+
- Share a `document` with a `team`
33+
- Grant `viewer` access to a `photo` to `followers` only
34+
- Make a `file` viewable for all `users` within an `organization`
35+
- Manage access to a `database` for `users` in a certain `locale`
3636

3737
</CardBox>
3838

39-
## Before You Start
39+
## Before you start
4040

41-
In order to understand this guide correctly you must be familiar with some <ProductConcept /> and know how to develop the things that we will list below.
41+
Familiarize yourself with basic <ProductConcept /> before you continue.
4242

4343
<details>
4444
<summary>
4545

46-
Assume that you have the following <ProductConcept section="what-is-an-authorization-model" linkName="authorization model" />.<br />
47-
You have two <ProductConcept section="what-is-a-type" linkName="types" />:
46+
In the example below, you have the following <ProductConcept section="what-is-an-authorization-model" linkName="authorization model" /> with two <ProductConcept section="what-is-a-type" linkName="types" />:
4847

49-
- `company` that can have a `employee` relation
48+
- `company` that can have an `employee` relation
5049
- `document` that can have a `reader` relation.
5150

5251
</summary>
@@ -90,27 +89,27 @@ You have two <ProductConcept section="what-is-a-type" linkName="types" />:
9089

9190
<hr />
9291

93-
In addition, you will need to know the following:
92+
In addition, the following concepts are important to group access management:
9493

95-
### Modeling User Groups
94+
### Modeling user groups
9695

97-
You need to know how to add users to groups and grant groups access to an object. [Learn more ](../modeling/user-groups.mdx)
96+
<ProductName format={ProductNameFormat.ShortForm}/> allows you to add users to groups and grant groups access to an object. [For more information, see User Groups.](../modeling/user-groups.mdx)
9897

9998
### <ProductName format={ProductNameFormat.ShortForm}/> Concepts
10099

101100
- A <ProductConcept section="what-is-a-type" linkName="Type" />: a class of objects that have similar characteristics
102101
- A <ProductConcept section="what-is-a-user" linkName="User" />: an entity in the system that can be related to an object
103-
- A <ProductConcept section="what-is-a-relation" linkName="Relation" />: is a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system
102+
- A <ProductConcept section="what-is-a-relation" linkName="Relation" />: a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system
104103
- An <ProductConcept section="what-is-an-object" linkName="Object" />: represents an entity in the system. Users' relationships to it can be define through relationship tuples and the authorization model
105104
- A <ProductConcept section="what-is-a-relationship-tuple" linkName="Relationship Tuple" />: a grouping consisting of a user, a relation and an object stored in <ProductName format={ProductNameFormat.ShortForm}/>
106105

107106
</details>
108107

109-
## Step By Step
108+
## Step by step
110109

111110
### 01. Adding Company To The Document
112111

113-
If we want to have every `employee` of a type `company` have a `reader` relationship with a particular object of type `document` (in this case `document:planning`), we need to add a tuple like so:
112+
The following <ProductConcept section="what-is-a-relationship-tuple" linkName="Relationship Tuple" /> assigns ever `employee` of a type `company` a `reader` relationship with a particular object of type `document`, in this case `document:planning`):
114113

115114
<RelationshipTuplesViewer
116115
relationshipTuples={[
@@ -123,9 +122,9 @@ If we want to have every `employee` of a type `company` have a `reader` relation
123122
]}
124123
/>
125124

126-
### 02. Adding Employee To The Company
125+
### 02. Add an employee to the company
127126

128-
If we also write a tuple that says that Anne is a `employee` of `company:xyz`, like so:
127+
Below is a <ProductConcept section="what-is-a-relationship-tuple" linkName="relationship tuple" /> specifying that `Anne` is an `employee` of `company:xyz`:
129128

130129
<WriteRequestViewer
131130
relationshipTuples={[
@@ -137,13 +136,13 @@ If we also write a tuple that says that Anne is a `employee` of `company:xyz`, l
137136
]}
138137
/>
139138

140-
### 03. Checking An Individual Member's Access To An Object
139+
### 03. Checking an individual member's access to an object
141140

142-
Then a call to the Check API to see whether Anne can read `document:planning` will return true:
141+
Call the Check API to verify that Anne can read `document:planning` returns true:
143142

144143
<CheckRequestViewer user={'user:anne'} relation={'reader'} object={'document:planning'} allowed={true} />
145144

146-
The same check for a different user Becky, however, will return false, because Becky does not have an `employee` relationship with `company:xyz`:
145+
The same check for Becky, a different user, returns false, because Becky does not have an `employee` relationship with `company:xyz`:
147146

148147
<CheckRequestViewer user={'user:becky'} relation={'reader'} object={'document:planning'} allowed={false} />
149148

docs/content/interacting/transactional-writes.mdx

+20-22
Original file line numberDiff line numberDiff line change
@@ -21,24 +21,22 @@ import {
2121

2222
<DocumentationNotice />
2323

24-
In this guide you will learn how to update multiple <ProductConcept section="what-is-a-relationship-tuple" linkName="relationship tuples" /> in a single transaction.
24+
Using<ProductName format={ProductNameFormat.ShortForm}/>, you can update multiple <ProductConcept section="what-is-a-relationship-tuple" linkName="relationship tuples" /> in a single transaction.
2525

2626
<CardBox title="When to use" appearance="filled">
2727

28-
Updating multiple relationship tuples is useful to keep system state consistent.
28+
Updating multiple relationship tuples can keep your system state consistent.
2929

3030
</CardBox>
3131

3232
## Before You Start
3333

34-
In order to understand this guide correctly you must be familiar with some <ProductConcept /> and know how to develop the things that we will list below.
34+
Familiarize yourself with basic <ProductConcept /> before completing this guide.
3535

3636
<details>
3737
<summary>
3838

39-
Assume that you have the following <ProductConcept section="what-is-an-authorization-model" linkName="authorization model" />.<br />
40-
You have a <ProductConcept section="what-is-a-type" linkName="type" /> called `tweet` that can have a `reader`.
41-
You have another type called `user` that can have a `follower` and `followed_by` relationship.
39+
In the following <ProductConcept section="what-is-an-authorization-model" linkName="authorization model" />, there is <ProductConcept section="what-is-a-type" linkName="type" /> called `tweet` that can have a `reader`. There is another type called `user` that can have a `follower` and `followed_by` relationship.
4240

4341
</summary>
4442

@@ -88,31 +86,31 @@ You have another type called `user` that can have a `follower` and `followed_by`
8886

8987
<hr />
9088

91-
In addition, you will need to know the following:
89+
In addition:
9290

93-
### Direct Access
91+
### Direct access
9492

95-
You need to know how to create an authorization model and create a relationship tuple to grant a user access to an object. [Learn more](../modeling/direct-access.mdx)
93+
Creating an authorization model and a relationship tuple grants a user access to an object. To learn more, [read about Direct Access.](../modeling/direct-access.mdx)
9694

97-
### Modeling Public Access
95+
### Modeling public access
9896

99-
You need to know how to grant public access to an object. [Learn more →](../modeling/public-access.mdx)
97+
The following example uses public access. To learn more, [read about Public Access.](../modeling/direct-access.mdx)
10098

101-
### <ProductName format={ProductNameFormat.ShortForm}/> Concepts
99+
### <ProductName format={ProductNameFormat.ShortForm}/> concepts
102100

103101
- A <ProductConcept section="what-is-a-type" linkName="Type" />: a class of objects that have similar characteristics
104102
- A <ProductConcept section="what-is-a-user" linkName="User" />: an entity in the system that can be related to an object
105103
- A <ProductConcept section="what-is-a-relation" linkName="Relation" />: is a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system
106-
- An <ProductConcept section="what-is-an-object" linkName="Object" />: represents an entity in the system. Users' relationships to it can be define through relationship tuples and the authorization model
107-
- A <ProductConcept section="what-is-a-relationship-tuple" linkName="Relationship Tuple" />: a grouping consisting of a user, a relation and an object stored in <ProductName format={ProductNameFormat.ShortForm}/>
104+
- A <ProductConcept section="what-is-a-relation" linkName="Relation" />: a string defined in the type definition of an authorization model that defines the possibility of a relationship between an object of the same type as the type definition and a user in the system
105+
- A <ProductConcept section="what-is-a-relationship-tuple" linkName="Relationship Tuple" />: a group stored in <ProductName format={ProductNameFormat.ShortForm}/> that consists of a user, a relation, and an object
108106

109107
</details>
110108

111-
## Step By Step
109+
## Step by step
112110

113-
### 01. Adding And Removing Relationship Tuples In The Same Transaction
111+
### 01. Add and remove relationship tuples in the same transaction
114112

115-
When you need to add or delete tuples in your store, you can do so by calling the Write API. For example, if you want to make `tweet:1` public by making everyone a `viewer`, you write one tuple:
113+
A call to the Write API can add or delete tuples in your store. For example, the following tuple makes `tweet:1` public by making everyone a `viewer`:
116114

117115
<WriteRequestViewer
118116
relationshipTuples={[
@@ -124,7 +122,7 @@ When you need to add or delete tuples in your store, you can do so by calling th
124122
]}
125123
/>
126124

127-
And if you want to convert this `tweet` to private, you would need to delete that tuple:
125+
Deleting the previous tuple converts this `tweet` to private:
128126

129127
<WriteRequestViewer
130128
deleteRelationshipTuples={[
@@ -168,9 +166,9 @@ The Write API allows you to send up to 100 unique tuples in the request. (This l
168166
]}
169167
/>
170168

171-
### 02. Adding Multiple Related Relationship Tuples In The Same Transaction
169+
### 02. Add multiple related relationship tuples in the same transaction
172170

173-
Having the ability to send multiple tuples per request is also useful when you want to maintain consistency. For example, if `anne` starts following `becky`, we want to be able to save the following two tuples, or neither of them:
171+
Sending multiple tuples per request can also help maintain consistency. For example, if `anne` follows `becky`, you can save the following two tuples or neither of them:
174172

175173
<RelationshipTuplesViewer
176174
relationshipTuples={[
@@ -190,10 +188,10 @@ Having the ability to send multiple tuples per request is also useful when you w
190188
/>
191189

192190
:::info
193-
We have a type called user in this case because users can be related to each other, so the users now are a type in the system
191+
In this case, the type `user` exists because users can be related to each other, so users now are a type in the system.
194192
:::
195193

196-
The <ProductName format={ProductNameFormat.LongForm}/> service will attempt to perform all the changes sent in a single Write API call in one transaction. If it can't (for example, if any of the requested changes fails), it will reject all of the changes.
194+
The <ProductName format={ProductNameFormat.LongForm}/> service attempts to perform all the changes sent in a single Write API call in one transaction. If it cannot complete all the changes, it rejects all of them.
197195

198196
## Related Sections
199197

0 commit comments

Comments
 (0)