Skip to content

Commit 1f27bd8

Browse files
committed
[Seaography] Docs
1 parent d520b73 commit 1f27bd8

File tree

5 files changed

+10
-6
lines changed

5 files changed

+10
-6
lines changed

Seaography/docs/01-index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,5 @@
3737
2. [Schema Restrictions](06-access-control/02-schema-restrictions.md)
3838
3. [Entity / Field Guards](06-access-control/03-guards.md)
3939
4. [Fine-grained Filters](06-access-control/04-filters.md)
40-
5. [Role Based Access Control](06-access-control/05-RBAC.md)
40+
5. [Role Based Access Control](06-access-control/05-rbac.md)
4141
6. [Considerations](06-access-control/06-considerations.md)

Seaography/docs/04-custom-endpoints/03-custom-mutation.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,11 @@ pub struct Coupon {
6969
}
7070
```
7171

72-
Then we can define the mutation endpoint:
72+
Then we can define the mutation endpoint. The business logic is:
73+
74+
1. Look up the specifc customer and film
75+
2. Find if there is inventory in store. If not, return error
76+
3. Create a new rental record and remove the item from inventory
7377

7478
```rust
7579
#[CustomFields]
@@ -86,7 +90,7 @@ impl Operations {
8690
// ⬆ create a transaction to make operation atomic
8791

8892
let customer = Customer::find_by_name(rental_request.customer, &txn).await?;
89-
let film = Film::find_by_name(rental_request.film, &txn).await?;
93+
let film = Film::find_by_title(rental_request.film, &txn).await?;
9094
// ⬆ helper methods to find the corresponding customer and film
9195

9296
// ⬇ find if there is inventory in current store

Seaography/docs/06-access-control/02-schema-restrictions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ pub enum RelatedEntity {
3737

3838
## No mutation
3939

40-
You can also register entities without mutation if you intend to implement all mutations with custom endpoints:
40+
You can also register entities without mutation if you intend to implement all mutations with custom operations:
4141

4242
```rust
4343
seaography::register_entity!(builder, actor, mutation: false);
@@ -58,6 +58,6 @@ pub struct Model {
5858
}
5959
```
6060

61-
This column will still be usable in other parts of the application, for example in custom endpoints. But it will not be visible to clients.
61+
This column will still be usable in other parts of the application, for example in custom operations. But it will not be visible to clients.
6262

6363
If you remove this field from the struct, then this column will not be visible to the entire application.
File renamed without changes.

Seaography/docs/06-access-control/06-considerations.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Combining RBAC with Entity Filters, it lets you implement rules such as "admins
2525
For **end‑user facing applications**, resources often have an *owner* (e.g. a user's own posts, orders, or profile).
2626
In these cases, you can enforce access by:
2727
- Adding **Filters** to queries so users only see their own data.
28-
- Using **Guards** on mutations to ensure a user can only read, update or delete resources they own.
28+
- Using **Guards** on queries / mutations to ensure a user can only read, update or delete resources they own.
2929

3030
This pattern is common in SaaS where each user should only interact with their own records.
3131

0 commit comments

Comments
 (0)