Skip to content

Commit fff094e

Browse files
authored
Merge pull request #793 from Azure/m5i/abac_multi_conditions
doc: add multi-conditions scenario to ABAC Repo Permissions doc
2 parents 2249057 + e5b4d3d commit fff094e

File tree

5 files changed

+32
-0
lines changed

5 files changed

+32
-0
lines changed

docs/preview/abac-repo-permissions/README.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,38 @@ By following these steps, users will have read access to all repositories with t
358358
359359
![Create the following ABAC rule with a negation rule to exclude the repository application/secret when granting read permissions.](./media/14-abac-condition-to-exclude-specific-repository-application-secret.png)
360360
361+
#### Scenario: Different ABAC conditions for different actions
362+
363+
This section applies for the scenario where you need to:
364+
365+
1. Grant read and pull permissions to all child repositories under the `application/frontend/` namespace, such as `application/frontend/platform` and `application/frontend/code`.
366+
2. Grant push and delete permissions to repositories under the `application/frontend/` namespace except `application/frontend/readonly`.
367+
368+
To meet the requirements, you can set different conditions for different actions in a single role assignment.
369+
370+
1. Use the **+ Add condition** to add the first condition:
371+
372+
![Proceed to add a condition.](./media/6-add-conditions-overview.png)
373+
374+
2. Use the **+Add action** to select readonly actions that apply to the first condition and use the **+Add expression** to build an expression for the actions:
375+
376+
![Select readonly actions to grant and build an expression in the conditional role assignment.](./media/15-set-first-condition.png)
377+
378+
3. Use the **+ Add condition** to add the second condition for push action. The push action needs to be added separately because it attribute source is different from other actions.
379+
380+
![Select push action to grant and build an expression in the conditional role assignment.](./media/16-set-second-condition.png)
381+
382+
3. Use the **+ Add condition** to add the third condition for other actions.
383+
384+
![Select other actions to grant and build an expression in the conditional role assignment.](./media/17-set-third-condition.png)
385+
386+
4. Review the conditions to ensure they align with the desired access limitations. You can set editor type to **Code** to inspect the conditions code:
387+
388+
![Review conditions in the conditional role assignment.](./media/18-review-conditions.png)
389+
390+
5. Use **Save** to confirm the role assignment to enforce the scoped permissions.
391+
392+
361393
## Private Preview Limitations of ABAC-Enabled Repository Permissions
362394
363395
During the private preview of ABAC-enabled Repository Permissions, there are a few limitations that you should be aware of:
219 KB
Loading
199 KB
Loading
253 KB
Loading
374 KB
Loading

0 commit comments

Comments
 (0)