File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change 19
19
-->
20
20
21
21
## Upcoming Release
22
+ * Added null check and empty list check to the permissions object in the ToPSRoleDefinition method.
22
23
* Added argument completer for ` EnforcementMode ` , ` IdentityType `
23
24
* ` New-AzPolicyAssignment `
24
25
* ` New-AzPolicyExemption `
Original file line number Diff line number Diff line change 16
16
using Microsoft . Azure . Commands . ActiveDirectory ;
17
17
using Microsoft . Azure . Management . Authorization . Models ;
18
18
using System ;
19
+ using System . Collections ;
19
20
using System . Collections . Generic ;
20
21
using System . Globalization ;
21
22
using System . Linq ;
@@ -58,8 +59,8 @@ public static PSRoleDefinition ToPSRoleDefinition(this RoleDefinition role)
58
59
AssignableScopes = role . AssignableScopes . ToList ( ) ,
59
60
Description = role . Description ,
60
61
IsCustom = role . RoleType == CustomRole ? true : false ,
61
- Condition = role ? . Permissions ? [ 0 ] ? . Condition ,
62
- ConditionVersion = role ? . Permissions ? [ 0 ] ? . ConditionVersion
62
+ Condition = ( role . Permissions != null && role . Permissions . Count > 0 ) ? role . Permissions [ 0 ] . Condition : null ,
63
+ ConditionVersion = ( role . Permissions != null && role . Permissions . Count > 0 ) ? role . Permissions [ 0 ] . ConditionVersion : null
63
64
} ;
64
65
}
65
66
You can’t perform that action at this time.
0 commit comments