|
| 1 | +# Access Control |
| 2 | + |
| 3 | +With Choreo, administrators can control user access to different projects and environments within the organization. |
| 4 | +At the finest granularity level, an administrator can restrict a user to perform a specific action on a specific project and a specific environment. |
| 5 | + |
| 6 | +## Fundamental Question in Access Control |
| 7 | + |
| 8 | +Access control in any system ultimately comes down to answering the following question. |
| 9 | + |
| 10 | +> *Can this **user** perform this **action** on this **resource**?* |
| 11 | +
|
| 12 | +???+ example |
| 13 | + Can Harry view logs of development environment of engineering project? |
| 14 | + |
| 15 | + - `Harry` is the **user** |
| 16 | + - `view logs` is the **action** |
| 17 | + - `development environment of engineering project` is the **resource** |
| 18 | + |
| 19 | +## Permission |
| 20 | + |
| 21 | +In Choreo access control model, a permission is the right to perform a specific action. |
| 22 | + |
| 23 | +???+ example |
| 24 | + A user can create a component only if the user has `Create Component` permission. |
| 25 | + |
| 26 | +### Environment Specific Permissions |
| 27 | + |
| 28 | +In Choreo, actions such as `deploy component`, `promote component`, `create configuration groups`, and `view logs` must be performed within the context of an environment. The permissions which give the right to perform such actions are categorized as **Environment Specific** permissions. |
| 29 | + |
| 30 | +!!! note |
| 31 | + For actions tied to an environment, it is sometimes necessary to allow a user to perform the action in certain environments but not in others; for example, a developer may be allowed to view logs in the development environment but not in the production environment. |
| 32 | + |
| 33 | +## Role |
| 34 | + |
| 35 | +Assigning permissions individually to each user is a time-consuming and error prone task. Users with similar job responsibilities often need the same set of permissions, which is why **roles** exist. A role is a collection of permissions designed to reflect real-world job responsibilities. |
| 36 | + |
| 37 | +Roles simplify permission management. For example, instead of assigning 20 permissions to each of 50 developers (1000 assignments), you can assign the 20 permissions to a Developer role and then assign that role to each developer (20 + 50 assignments). |
| 38 | + |
| 39 | +!!! info |
| 40 | + Each organization in Choreo comes with a set of predefined roles with default permissions. Organization administrators can customize these roles or create new ones as needed. |
| 41 | + |
| 42 | +## Group |
| 43 | + |
| 44 | +A group is a collection of users, usually organized by team or department. |
| 45 | + |
| 46 | +Instead of assigning a role to each user, you assign the role to the group. Every user in the group automatically gets the group’s permissions. This makes updates easier. For example, instead of removing 50 role-to-user assignments and creating 50 new ones, you only need to remove one role-to-group assignment and add one new assignment. |
| 47 | + |
| 48 | +!!! info |
| 49 | + Each organization in Choreo comes with a set of predefined groups. By default, each group is mapped to a role with the same name. Organization administrators can customize these groups or create new ones as needed. |
| 50 | + |
| 51 | +## Permission to Role Assignment |
| 52 | + |
| 53 | +In Choreo, all permission-to-role assignments apply across the organization. You can’t restrict these assignments to specific resources. For example, you can’t configure Choreo to grant the `View Logs` permission to the `Developer` role only in the Development environment of the Engineering project. |
| 54 | + |
| 55 | +## Role to Group Assignment |
| 56 | + |
| 57 | +The real strength of Choreo Access Control comes from role-to-group assignments. These assignments can include resource-specific restrictions. For example, you can assign the `Developer` role to the `Engineering Project Developer` group, but limit it to the Development environment of the Engineering project. |
| 58 | + |
| 59 | +Each role-to-group assignment has two attributes: |
| 60 | + |
| 61 | +1. **Mapping Level** : Defines whether the assignment applies to the entire `Organization` or only to a specific `Project`. |
| 62 | +2. **Applicable Environment** : Defines whether the assignment applies to `All` environments or only to a specific `Environment`. |
| 63 | + |
| 64 | +By combining these attributes, you can create four types of assignments. |
| 65 | + |
| 66 | +|Assignment Type|Mapping Level|Appicable Environment| |
| 67 | +|-|-|-| |
| 68 | +|`Organization Scoped`|Organization|All| |
| 69 | +|`Project Scoped`|Project|All| |
| 70 | +|`Environement Scoped`|Organization|Environment| |
| 71 | +|`Project-Environment Scoped`|Project|Environment| |
| 72 | + |
| 73 | +!!! warning "Important" |
| 74 | + Avoid assigning multiple roles to the same group across different projects or mapping levels (organization and project). Doing so can give users unintended permissions in some projects, allowing access to tasks they shouldn’t perform. To ensure proper access control, assign only one role to a group across projects or mapping levels. |
| 75 | + |
| 76 | +## Extent of Access granted through different Role to Group assignment types |
| 77 | + |
| 78 | +Recall the [Fundamental Question in Access Control](#fundamental-question-in-access-control). |
| 79 | + |
| 80 | +> *Can this **user** perform this **action** on this **resource**?* |
| 81 | +
|
| 82 | +Based on this question, the extent of access has two parts. |
| 83 | + |
| 84 | +1. Allowed **actions** |
| 85 | + |
| 86 | +2. Allowed **resources** (the resources on which those actions can be performed) |
| 87 | + |
| 88 | +Next, let’s go through each role-to-group assignment type to see the extent of access it grants. We’ll look at both the allowed **actions** and the allowed **resources**. |
| 89 | + |
| 90 | +### Organization Scoped Assignments |
| 91 | + |
| 92 | +- Actions permitted by the role are allowed on resources within the organization. |
| 93 | +- All other actions are not allowed. |
| 94 | + |
| 95 | +!!! note |
| 96 | + Actions permitted by a role are the actions linked to the permissions assigned to the role. |
| 97 | + |
| 98 | +### Project Scoped Assignments |
| 99 | + |
| 100 | +- Actions permitted by the role are allowed on resources within the specific project. |
| 101 | +- All other actions are not allowed. |
| 102 | + |
| 103 | +### Environement Scoped Assignments |
| 104 | + |
| 105 | +- Environment specific actions permitted by the role are allowed on resources within the specific environment of the organization. |
| 106 | +- Other actions permitted by the role are allowed on resources within the organization. |
| 107 | +- All other actions are not allowed. |
| 108 | + |
| 109 | +!!! note |
| 110 | + **Environment specific actions** permitted by a role are the actions linked to the [**environment specific permissions**](#environment-specific-permissions) assigned to the role. |
| 111 | + |
| 112 | +For environement scoped assignments, allowing **non environment specific** actions on resources across organization is intentional. This design aligns with real world Access Control use cases. |
| 113 | + |
| 114 | +!!! example |
| 115 | + Suppose you assign the Developer role to the Engineering Developer group, but only for the Development environment of the Engineering project. The purpose of this assignment is not to prevent developers from performing actions like `build component`, which don’t depend on a specific environment. Instead, the goal is to restrict developers from performing actions such as `promote component` on environments they aren’t authorized to access, like Production. |
| 116 | + |
| 117 | +!!! warning "Important" |
| 118 | + Exercise care when creating environment scoped role-to-group assignments. Only environment specific actions are restricted to that environment; all other actions remain allowed on resources across the organization. |
| 119 | + |
| 120 | +### Project-Environment Scoped Assignments |
| 121 | + |
| 122 | +- Environment Specific actions permitted by the role are allowed on resources within the specific Environment of the specific Project. |
| 123 | +- Other actions permitted by the role are allowed on resources within the specific Project. |
| 124 | +- All other actions are not allowed. |
| 125 | + |
| 126 | +Similar to previous case, allowing **non environment specific** actions on resources across project is intentional. This design aligns with real world Access Control use cases. |
| 127 | + |
| 128 | +!!! warning "Important" |
| 129 | + Exercise care when creating project-environment scoped role-to-group assignments. Only environment specific actions are restricted to that environment; all other actions remain allowed on resources across the project. |
| 130 | + |
| 131 | +Now that you understand the access control concepts in Choreo, see [Configure Access Control](../administer/configure-access-control.md) for a walkthrough on how to set it up. |
0 commit comments