Skip to content

Commit

Permalink
rename method
Browse files Browse the repository at this point in the history
  • Loading branch information
shinyhappydan committed Sep 29, 2023
1 parent a38f54e commit 399c983
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ final class UserPermissionsRoutes(identities: Identities, aclCheck: AclCheck, st
}
},
parameters("storage".as[IdSegment], "type".as[AccessType]) { (storageId, `type`) =>
authorizeForAsync(
authorizeForIO(
AclAddress.fromProject(project),
storages.permissionFor(IdSegmentRef(storageId), project, `type`)
)(caller) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ abstract class AuthDirectives(identities: Identities, aclCheck: AclCheck) {
def authorizeFor(path: AclAddress, permission: Permission)(implicit caller: Caller): Directive0 =
authorizeAsync(toCatsIO(aclCheck.authorizeFor(path, permission)).unsafeToFuture()) or failWith(AuthorizationFailed)

def authorizeForAsync(path: AclAddress, fetchPermission: IO[Permission])(implicit caller: Caller): Directive0 = {
def authorizeForIO(path: AclAddress, fetchPermission: IO[Permission])(implicit caller: Caller): Directive0 = {
val check = fetchPermission.flatMap(permission => toCatsIO(aclCheck.authorizeFor(path, permission)))
authorizeAsync(check.unsafeToFuture()) or failWith(AuthorizationFailed)
}
Expand Down

0 comments on commit 399c983

Please sign in to comment.