Skip to content

Commit

Permalink
more group debug
Browse files Browse the repository at this point in the history
  • Loading branch information
skykanin committed Dec 3, 2024
1 parent 49c0415 commit 524539f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/utils/services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,14 @@ const fetchGroupMembership = async (groupUniformName: string): Promise<Group> =>

export const isDaplaAdmin = async (userPrincipalName: string): Promise<boolean> => {
const adminGroups = import.meta.env.DAPLA_CTRL_ADMIN_GROUPS ?? ''
const daplaAdminGroupsSeperated = adminGroups.split(',')
const daplaAdminGroupsSeperated: string[] = adminGroups.split(',')
if (daplaAdminGroupsSeperated.length === 0) return false

console.log(`daplaAdminGroupsSeparated:`, daplaAdminGroupsSeperated)

try {
const adminGroupUsers = await Promise.all(
daplaAdminGroupsSeperated.map((groupUniformName) => fetchGroupMembership(groupUniformName))
daplaAdminGroupsSeperated.map((groupUniformName: string) => fetchGroupMembership(groupUniformName))
)

return adminGroupUsers.some(
Expand Down

0 comments on commit 524539f

Please sign in to comment.