Skip to content

Commit

Permalink
ID-807 clarifying comment on new directive
Browse files Browse the repository at this point in the history
  • Loading branch information
Greg Polumbo committed Oct 26, 2023
1 parent 41b3163 commit 221c8a9
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ trait SamUserDirectives {
}
}

// Ideally, we would just make this check from inside the *Service.scala code, but not all Services have access to
// cloudExtensions and I don't think we should add cloudExtensions just for checking if a user is an admin. So this
// was added so we can do the "isAdmin calculation" in the routes, just like we've always done it, but then pass this
// data into the Services to let them make their own authz determination. If we can change the way we define admins
// from _not_ depending on Google, then we may be able to get rid of this directive.
def isWorkbenchAdmin(samUser: SamUser): Directive1[Boolean] =
onSuccess(cloudExtensions.isWorkbenchAdmin(samUser.email))

Expand Down

0 comments on commit 221c8a9

Please sign in to comment.