@@ -390,6 +390,60 @@ class PrincipalType(str, Enum):
390390 with self .argument_context ('role assignment delete' ) as c :
391391 c .argument ('yes' , options_list = ['--yes' , '-y' ], action = 'store_true' , help = 'Currently no-op.' )
392392
393+ with self .argument_context ('role deny-assignment' ) as c :
394+ c .argument ('scope' , help = 'Scope at which the deny assignment applies. '
395+ 'For example, /subscriptions/00000000-0000-0000-0000-000000000000 or '
396+ '/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myGroup' )
397+ c .argument ('deny_assignment_name' , options_list = ['--name' , '-n' ],
398+ help = 'The display name of the deny assignment.' )
399+
400+ with self .argument_context ('role deny-assignment list' ) as c :
401+ c .argument ('filter_str' , options_list = ['--filter' ],
402+ help = 'OData filter expression to apply. For example, '
403+ '"atScope()" to list at the current scope, or '
404+ '"gdprExportPrincipalId eq \' {objectId}\' " to list for a specific principal.' )
405+
406+ with self .argument_context ('role deny-assignment show' ) as c :
407+ c .argument ('deny_assignment_id' , options_list = ['--id' ],
408+ help = 'The fully qualified ID of the deny assignment including scope, '
409+ 'e.g. /subscriptions/{id}/providers/Microsoft.Authorization/denyAssignments/{denyAssignmentId}' )
410+ c .argument ('deny_assignment_name' , options_list = ['--name' , '-n' ],
411+ help = 'The name (GUID) of the deny assignment.' )
412+
413+ with self .argument_context ('role deny-assignment create' ) as c :
414+ c .argument ('deny_assignment_name' , options_list = ['--name' , '-n' ],
415+ help = 'The display name of the deny assignment.' )
416+ c .argument ('description' , help = 'Description of the deny assignment.' )
417+ c .argument ('actions' , nargs = '+' ,
418+ help = 'Space-separated list of actions to deny, e.g. '
419+ '"Microsoft.Authorization/roleAssignments/write". '
420+ 'Note: read actions (*/read) are not permitted for user-assigned deny assignments.' )
421+ c .argument ('not_actions' , nargs = '+' ,
422+ help = 'Space-separated list of actions to exclude from the deny.' )
423+ c .argument ('principal_id' , options_list = ['--principal-object-id' ],
424+ help = 'The object ID of a specific User or ServicePrincipal to deny. '
425+ 'If omitted, the deny assignment applies to Everyone (all principals) and '
426+ '--exclude-principal-ids is required. Group principals are not permitted.' )
427+ c .argument ('principal_type' , options_list = ['--principal-type' ],
428+ arg_type = get_enum_type (['User' , 'ServicePrincipal' ]),
429+ help = 'The type of the principal specified by --principal-object-id. '
430+ 'Required when --principal-object-id is provided. Accepted values: User, ServicePrincipal.' )
431+ c .argument ('exclude_principal_ids' , nargs = '+' , options_list = ['--exclude-principal-ids' ],
432+ help = 'Space-separated list of principal object IDs to exclude from the deny. '
433+ 'Required when no --principal-object-id is specified (Everyone mode). '
434+ 'Optional when --principal-object-id is specified.' )
435+ c .argument ('exclude_principal_types' , nargs = '+' , options_list = ['--exclude-principal-types' ],
436+ help = 'Space-separated list of principal types corresponding to --exclude-principal-ids. '
437+ 'Accepted values: User, Group, ServicePrincipal.' )
438+ c .argument ('assignment_name' , options_list = ['--assignment-name' ],
439+ help = 'A GUID for the deny assignment. If omitted, a new GUID is generated.' )
440+
441+ with self .argument_context ('role deny-assignment delete' ) as c :
442+ c .argument ('deny_assignment_id' , options_list = ['--id' ],
443+ help = 'The fully qualified ID of the deny assignment to delete.' )
444+ c .argument ('deny_assignment_name' , options_list = ['--name' , '-n' ],
445+ help = 'The name (GUID) of the deny assignment to delete.' )
446+
393447 with self .argument_context ('role definition' ) as c :
394448 c .argument ('custom_role_only' , arg_type = get_three_state_flag (), help = 'custom roles only(vs. build-in ones)' )
395449 c .argument ('role_definition' , help = "json formatted content which defines the new role." )
0 commit comments