Fix board share entity authorization
This commit is contained in:
1 parent
0f36990040
commit
a5f4a39f2b
7 files changed
+236
-10
No files matched your search
@@ -18,6 +18,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;
|
||||
}
|
||||
@@ -42,6 +46,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;
|
||||
}
|
||||
@@ -66,6 +74,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