Merge pull request #4317 from umami-software/opencode/nimble-planet
Fix board share entity authorization
This commit is contained in:
7 files changed
+252
-10
No files matched your search
@@ -22,6 +22,10 @@ export async function canViewPixel({ user, shareToken }: Auth, pixelId: string)
|
||||
|
||||
const pixel = await getPixel(pixelId);
|
||||
|
||||
if (!pixel) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (pixel.userId) {
|
||||
return user.id === pixel.userId;
|
||||
}
|
||||
@@ -46,6 +50,10 @@ export async function canUpdatePixel({ user }: Auth, pixelId: string) {
|
||||
|
||||
const pixel = await getPixel(pixelId);
|
||||
|
||||
if (!pixel) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (pixel.userId) {
|
||||
return user.id === pixel.userId;
|
||||
}
|
||||
@@ -70,6 +78,10 @@ export async function canDeletePixel({ user }: Auth, pixelId: string) {
|
||||
|
||||
const pixel = await getPixel(pixelId);
|
||||
|
||||
if (!pixel) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (pixel.userId) {
|
||||
return user.id === pixel.userId;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user