Skip to content

Commit 7482a62

Browse files
Skip checking for inherited roleassignment if owner is unavailable (#4450)
1 parent 77e69f1 commit 7482a62

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

v2/api/authorization/customizations/role_assignment_extensions.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ func (extension *RoleAssignmentExtension) Import(
3333
if assignment, ok := rsrc.(*api.RoleAssignment); ok {
3434
// Check to see whether this role assignment is inherited or not
3535
// (we can tell by looking at the scope of the assignment)
36-
if assignment.Status.Scope != nil {
36+
if assignment.Status.Scope != nil && owner != nil {
3737
if !strings.EqualFold(owner.ARMID, *assignment.Status.Scope) {
3838
// Scope isn't our owner, so it's inherited from further up and should not be imported
3939
return extensions.ImportSkipped("role assignment is inherited"), nil

0 commit comments

Comments
 (0)