Skip to content

Commit

Permalink
PROD-972 Add group version increment to onPolicyUpdate
Browse files Browse the repository at this point in the history
  • Loading branch information
Ghost-in-a-Jar committed Jul 15, 2024
1 parent f006c05 commit e9694ee
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -717,6 +717,10 @@ class ResourceService(
changeEvents = createAccessChangeEvents(policyId.resource, originalPolicies, updatedPolicies)
_ <- AuditLogger.logAuditEventIO(samRequestContext, changeEvents.toSeq: _*)

_ <- directoryDAO.updateGroupUpdatedDateAndVersionWithSession(
FullyQualifiedPolicyId(policyId.resource, policyId.accessPolicyName),
samRequestContext
)
_ <- cloudExtensions.onGroupUpdate(Seq(policyId), removedMembers ++ addedMembers, samRequestContext).attempt.flatMap {
case Left(regrets) => IO(logger.error(s"error calling cloudExtensions.onGroupUpdate for $policyId", regrets))
case Right(_) => IO.unit
Expand Down Expand Up @@ -885,10 +889,6 @@ class ResourceService(
for {
originalPolicies <- accessPolicyDAO.listAccessPolicies(policyId.resource, samRequestContext)
policyChanged <- accessPolicyDAO.setPolicyIsPublic(policyId, public, samRequestContext)
_ <- directoryDAO.updateGroupUpdatedDateAndVersionWithSession(
FullyQualifiedPolicyId(policyId.resource, policyId.accessPolicyName),
samRequestContext
)
_ <- onPolicyUpdateIfChanged(policyId, originalPolicies, samRequestContext)(policyChanged)
} yield ()
}
Expand Down

0 comments on commit e9694ee

Please sign in to comment.