mirror of
https://github.com/umami-software/umami.git
synced 2026-02-08 22:57:12 +01:00
Added additional logic for handling website transfers.
This commit is contained in:
parent
08b2f69658
commit
a3f7382673
4 changed files with 43 additions and 45 deletions
|
|
@ -102,10 +102,6 @@ export async function canUpdateWebsite({ user }: Auth, websiteId: string) {
|
|||
}
|
||||
|
||||
export async function canTransferWebsiteToUser({ user }: Auth, websiteId: string, userId: string) {
|
||||
if (user.isAdmin) {
|
||||
return true;
|
||||
}
|
||||
|
||||
const website = await loadWebsite(websiteId);
|
||||
|
||||
if (website.teamId && user.id === userId) {
|
||||
|
|
@ -118,10 +114,6 @@ export async function canTransferWebsiteToUser({ user }: Auth, websiteId: string
|
|||
}
|
||||
|
||||
export async function canTransferWebsiteToTeam({ user }: Auth, websiteId: string, teamId: string) {
|
||||
if (user.isAdmin) {
|
||||
return true;
|
||||
}
|
||||
|
||||
const website = await loadWebsite(websiteId);
|
||||
|
||||
if (website.userId === user.id) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue