|
56 | 56 | "Delete classic administrators who no longer need access or assign an Azure RBAC role for fine-grained access " |
57 | 57 | "control. Learn more: https://go.microsoft.com/fwlink/?linkid=2238474") |
58 | 58 |
|
| 59 | +ROLE_ASSIGNMENT_LIST_SCOPE_WARNING = ( |
| 60 | + "--scope argument will become required for listing role assignments " |
| 61 | + "in the breaking change release of the spring of 2025. " |
| 62 | + "Please explicitly specify --scope.") |
| 63 | + |
| 64 | +ROLE_ASSIGNMENT_DELETE_SCOPE_WARNING = ( |
| 65 | + "When --ids is not provided, --scope argument will become required for deleting role assignments " |
| 66 | + "in the breaking change release of the spring of 2025. " |
| 67 | + "Please explicitly specify --scope.") |
| 68 | + |
59 | 69 | logger = get_logger(__name__) |
60 | 70 |
|
61 | 71 | # pylint: disable=too-many-lines, protected-access |
@@ -219,6 +229,9 @@ def list_role_assignments(cmd, assignee=None, role=None, resource_group_name=Non |
219 | 229 | :param include_groups: include extra assignments to the groups of which the user is a |
220 | 230 | member(transitively). |
221 | 231 | ''' |
| 232 | + if not scope: |
| 233 | + logger.warning(ROLE_ASSIGNMENT_LIST_SCOPE_WARNING) |
| 234 | + |
222 | 235 | if include_classic_administrators: |
223 | 236 | logger.warning(CLASSIC_ADMINISTRATOR_WARNING) |
224 | 237 |
|
@@ -502,6 +515,9 @@ def _get_displayable_name(graph_object): |
502 | 515 |
|
503 | 516 | def delete_role_assignments(cmd, ids=None, assignee=None, role=None, resource_group_name=None, |
504 | 517 | scope=None, include_inherited=False, yes=None): |
| 518 | + if not ids and not scope: |
| 519 | + logger.warning(ROLE_ASSIGNMENT_DELETE_SCOPE_WARNING) |
| 520 | + |
505 | 521 | factory = _auth_client_factory(cmd.cli_ctx, scope) |
506 | 522 | assignments_client = factory.role_assignments |
507 | 523 | definitions_client = factory.role_definitions |
|
0 commit comments