mirror of
https://github.com/umami-software/umami.git
synced 2026-02-10 23:57:12 +01:00
Add Role to TeamUser.
This commit is contained in:
parent
502facd426
commit
d5437c895e
4 changed files with 38 additions and 29 deletions
|
|
@ -40,6 +40,27 @@ export async function getPermissionsByUserId(userId, name?: string): Promise<Per
|
|||
});
|
||||
}
|
||||
|
||||
export async function getPermissionsByTeamId(teamId, name?: string): Promise<Permission[]> {
|
||||
return prisma.client.permission.findMany({
|
||||
where: {
|
||||
...(name ? { name } : {}),
|
||||
RolePermission: {
|
||||
every: {
|
||||
role: {
|
||||
is: {
|
||||
TeamUser: {
|
||||
every: {
|
||||
teamId,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
export async function updatePermission(
|
||||
data: Prisma.PermissionUpdateInput,
|
||||
where: Prisma.PermissionWhereUniqueInput,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue