Skip to content

Commit

Permalink
will this wait for Future?
Browse files Browse the repository at this point in the history
  • Loading branch information
dvoet committed Dec 17, 2018
1 parent 35dc3ba commit da14aec
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -364,13 +364,13 @@ class ResourceService(
}

def addSubjectToPolicy(policyIdentity: FullyQualifiedPolicyId, subject: WorkbenchSubject): Future[Unit] =
directoryDAO.addGroupMember(policyIdentity, subject).unsafeToFuture().map(_ => ()) andThen {
case Success(_) => fireGroupUpdateNotification(policyIdentity)
directoryDAO.addGroupMember(policyIdentity, subject).unsafeToFuture().map(_ => ()) flatMap {
_ => fireGroupUpdateNotification(policyIdentity)
}

def removeSubjectFromPolicy(policyIdentity: FullyQualifiedPolicyId, subject: WorkbenchSubject): Future[Unit] =
directoryDAO.removeGroupMember(policyIdentity, subject).void.unsafeToFuture() andThen {
case Success(_) => fireGroupUpdateNotification(policyIdentity)
directoryDAO.removeGroupMember(policyIdentity, subject).void.unsafeToFuture() flatMap {
_ => fireGroupUpdateNotification(policyIdentity)
}

private[service] def loadAccessPolicyWithEmails(policy: AccessPolicy): IO[AccessPolicyMembership] = {
Expand Down

0 comments on commit da14aec

Please sign in to comment.