Skip to content

Commit 2607a67

Browse files
committed
Document permissions
1 parent c4a6e8f commit 2607a67

File tree

3 files changed

+37
-2
lines changed

3 files changed

+37
-2
lines changed

docs/permissions/limitation_reference.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ The `ActivityLogOwner` limitation specifies if a user can see only their own [re
4141
|-------|-----------------|--------------------------------------------------------------|
4242
| `1` | "Only own logs" | Current user can only access their own activity log entries. |
4343

44-
## CartOwner limitation
44+
## Cart Owner limitation
4545

46-
The `CartOwner` limitation specifies whether the user can modify a cart.
46+
The Cart Owner `CartOwner` limitation specifies whether the user can modify a cart.
4747

4848
### Possible values
4949

@@ -62,6 +62,16 @@ The Change Owner (`ChangeOwner`) limitation specifies whether the user can chang
6262
|------|------|------|
6363
|`1`|"Forbid"|The user cannot change owner of a content item|
6464

65+
## Discount Owner limitation
66+
67+
The Discount Owner `DiscountOwner` limitation specifies whether the user can interact with a discount.
68+
69+
### Possible values
70+
71+
|Value|UI value|Description|
72+
|------|------|------|
73+
|"self"|"self"|Only the user who is the owner of the discount gets access.|
74+
6575
## Content type Group limitation
6676

6777
The Content Type Group (`UserGroup`) limitation specifies that only users with at least one common *direct* user group with the owner of content get the selected access right.

docs/permissions/permission_use_cases.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,20 @@ Set the following permissions to decide what actions are available when users in
269269
- `checkout/update` - to allow users to modify existing information, for example item quantity
270270
- `checkout/delete` - to delete checkout
271271

272+
### Discount management
273+
274+
Set the following permissions to decide what actions are available when users interact with discounts:
275+
276+
- `discount/create` - to allow the user to create a new discount
277+
- `discount/update` - to allow the user to change the parameters of an existing discount
278+
- `discount/view` - to allow the user to view discounts
279+
- `discount/delete` - to delete an existing discount
280+
- `discount/enable` - to allow the user to enable an existing discount
281+
- `discount/disable` - to allow the user to disable an existing discount
282+
283+
To further control access to a discount, you can use the `DiscountOwner` limitation and set its value to `self`.
284+
This way users can only interact with their own discounts.
285+
272286
### Order management
273287

274288
Set the following permissions to decide what actions are available when users interact with orders:

docs/permissions/policies.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,17 @@ Each role you assign to user or user group consists of policies which define, wh
124124
| <nobr>`commerce`</nobr> | <nobr>`currency`</nobr> | manage currencies |
125125
| | <nobr>`region`</nobr> | manage regions |
126126

127+
#### Discounts [[% include 'snippets/commerce_badge.md' %]]
128+
129+
| Module | Function | Effect | Possible limitations |
130+
|----------------------|--------------------------|-----------------------------|----------------------------------------------------|
131+
| <nobr>`discount`</nobr> | <nobr>`create`</nobr> | create a discount | [DiscountOwner](limitation_reference.md#discount-owner-limitation) |
132+
| | <nobr>`delete`</nobr> | delete a discount | [DiscountOwner](limitation_reference.md#discount-owner-limitation) |
133+
| | <nobr>`enable`</nobr> | enable a discount | [DiscountOwner](limitation_reference.md#discount-owner-limitation) |
134+
| | <nobr>`disable`</nobr> | disable a discount | [DiscountOwner](limitation_reference.md#discount-owner-limitation) |
135+
| | <nobr>`update`</nobr> | modify discount parameters | [DiscountOwner](limitation_reference.md#discount-owner-limitation) |
136+
| | <nobr>`view`</nobr> | view discounts | [DiscountOwner](limitation_reference.md#discount-owner-limitation) |
137+
127138
#### Orders [[% include 'snippets/commerce_badge.md' %]]
128139

129140
| Module | Function | Effect | Possible limitations |

0 commit comments

Comments
 (0)