Skip to content

Commit

Permalink
Skip checking for inherited roleassignment if owner is unavailable (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
theunrepentantgeek authored Nov 18, 2024
1 parent 6d66802 commit 3a5dc18
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func (extension *RoleAssignmentExtension) Import(
if assignment, ok := rsrc.(*api.RoleAssignment); ok {
// Check to see whether this role assignment is inherited or not
// (we can tell by looking at the scope of the assignment)
if assignment.Status.Scope != nil {
if assignment.Status.Scope != nil && owner != nil {
if !strings.EqualFold(owner.ARMID, *assignment.Status.Scope) {
// Scope isn't our owner, so it's inherited from further up and should not be imported
return extensions.ImportSkipped("role assignment is inherited"), nil
Expand Down

0 comments on commit 3a5dc18

Please sign in to comment.