Skip to content

Commit

Permalink
rename methods
Browse files Browse the repository at this point in the history
  • Loading branch information
davidangb committed Jan 6, 2025
1 parent 33a7224 commit 4cff3e4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ trait DirectoryDAO {

def listFlattenedGroupMembers(groupName: WorkbenchGroupName, samRequestContext: SamRequestContext): IO[Set[WorkbenchUserId]]

def countDirectGroupMemberships(samUser: SamUser, samRequestContext: SamRequestContext): IO[Int]
def countDirectSynchronizedGroupMemberships(samUser: SamUser, samRequestContext: SamRequestContext): IO[Int]

def countIndirectGroupMemberships(samUser: SamUser, samRequestContext: SamRequestContext): IO[Int]
def countIndirectSynchronizedGroupMemberships(samUser: SamUser, samRequestContext: SamRequestContext): IO[Int]

def enableIdentity(subject: WorkbenchSubject, samRequestContext: SamRequestContext): IO[Unit]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -732,8 +732,8 @@ class PostgresDirectoryDAO(protected val writeDbRef: DbReference, protected val
}
}

override def countDirectGroupMemberships(samUser: SamUser, samRequestContext: SamRequestContext): IO[Int] =
readOnlyTransaction("countDirectGroupMemberships", samRequestContext) { implicit session =>
override def countDirectSynchronizedGroupMemberships(samUser: SamUser, samRequestContext: SamRequestContext): IO[Int] =
readOnlyTransaction("countDirectSynchronizedGroupMemberships", samRequestContext) { implicit session =>
val query = samsql"""select count(distinct g.id) directMembershipCount
from sam_group g
join sam_group_member gm on g.id = gm.group_id
Expand All @@ -743,8 +743,8 @@ class PostgresDirectoryDAO(protected val writeDbRef: DbReference, protected val
query.map(rs => rs.int(1)).single().apply().getOrElse(0)
}

override def countIndirectGroupMemberships(samUser: SamUser, samRequestContext: SamRequestContext): IO[Int] =
readOnlyTransaction("countDirectGroupMemberships", samRequestContext) { implicit session =>
override def countIndirectSynchronizedGroupMemberships(samUser: SamUser, samRequestContext: SamRequestContext): IO[Int] =
readOnlyTransaction("countIndirectSynchronizedGroupMemberships", samRequestContext) { implicit session =>
val query = samsql"""select count(distinct g.id) indirectMembershipCount
from sam_group g
join sam_group_member_flat gmf on g.id = gmf.group_id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -338,9 +338,9 @@ class MockDirectoryDAO(val groups: mutable.Map[WorkbenchGroupIdentity, Workbench
override def listFlattenedGroupMembers(groupName: WorkbenchGroupName, samRequestContext: SamRequestContext): IO[Set[WorkbenchUserId]] =
IO(listGroupUsers(groupName, Set.empty))

override def countDirectGroupMemberships(samUser: SamUser, samRequestContext: SamRequestContext): IO[Int] = ???
override def countDirectSynchronizedGroupMemberships(samUser: SamUser, samRequestContext: SamRequestContext): IO[Int] = ???

override def countIndirectGroupMemberships(samUser: SamUser, samRequestContext: SamRequestContext): IO[Int] = ???
override def countIndirectSynchronizedGroupMemberships(samUser: SamUser, samRequestContext: SamRequestContext): IO[Int] = ???

override def loadUserByAzureB2CId(userId: AzureB2CId, samRequestContext: SamRequestContext): IO[Option[SamUser]] =
IO.pure(users.values.find(_.azureB2CId.contains(userId)))
Expand Down

0 comments on commit 4cff3e4

Please sign in to comment.