fix sharetoken permissions on mixed boards
This commit is contained in:
1 parent
5e6f88f123
commit
a87d899e17
6 files changed
+44
-13
No files matched your search
@@ -1,4 +1,4 @@
|
||||
import { getBoardWebsiteIds } from '@/lib/boards';
|
||||
import { getBoardEntityIds } from '@/lib/boards';
|
||||
import { ENTITY_TYPE, ROLES } from '@/lib/constants';
|
||||
import { secret } from '@/lib/crypto';
|
||||
import { createToken } from '@/lib/jwt';
|
||||
@@ -66,10 +66,13 @@ export async function GET(_request: Request, { params }: { params: Promise<{ slu
|
||||
if (!board) return notFound();
|
||||
entity = board;
|
||||
data.boardId = share.entityId;
|
||||
data.websiteIds = getBoardWebsiteIds({
|
||||
const boardEntityIds = getBoardEntityIds({
|
||||
type: board.type,
|
||||
parameters: board.parameters as BoardParameters,
|
||||
});
|
||||
data.websiteIds = boardEntityIds.websiteIds;
|
||||
data.pixelIds = boardEntityIds.pixelIds;
|
||||
data.linkIds = boardEntityIds.linkIds;
|
||||
} else if (share.shareType === ENTITY_TYPE.website) {
|
||||
entity = await getWebsite(share.entityId);
|
||||
if (!entity) return notFound();
|
||||
|
||||
Reference in new issue
Block a user