mirror of
https://github.com/diced/zipline.git
synced 2025-12-05 20:40:12 -08:00
fix: long file & not viewing ur own files
This commit is contained in:
@@ -48,7 +48,7 @@ export async function handler(req: NextApiReq<any, Query>, res: NextApiRes<ApiUs
|
||||
},
|
||||
});
|
||||
|
||||
if (user && !canInteract(req.user.role, user.role))
|
||||
if (user && user.id !== req.user.id && !canInteract(req.user.role, user.role))
|
||||
return res.forbidden("You can't view this user's files.");
|
||||
|
||||
if (!user) return res.notFound('User not found');
|
||||
|
||||
@@ -112,8 +112,8 @@ export default function ViewFile({
|
||||
</Paper>
|
||||
</>
|
||||
) : (
|
||||
<Center h='100vh'>
|
||||
<Paper p='md' shadow='md' radius='md' withBorder>
|
||||
<Center h='100%'>
|
||||
<Paper m='md' p='md' shadow='md' radius='md' withBorder>
|
||||
<Group position='apart' mb='sm'>
|
||||
<Text size='lg' weight={700} sx={{ display: 'flex' }}>
|
||||
{file.name}
|
||||
|
||||
Reference in New Issue
Block a user