Joey
02/23/2022, 5:01 PMgetServerSideProps
Joey
02/23/2022, 5:01 PMAkshat
02/23/2022, 5:03 PMAkshat
02/23/2022, 5:03 PMJoey
02/23/2022, 5:17 PMAkshat
02/23/2022, 5:19 PMJoey
02/23/2022, 5:19 PMJoey
02/23/2022, 5:21 PMJoey
02/23/2022, 5:21 PMexport const getServerSideProps = withCapabilities(
withPagePermissionRequired<MyProps>(
async () => {
return {
props: {
status: 200,
}
}
},
(ctx) => Document(ctx.query.doc as string).view
),
(ctx) => Document(ctx.query.doc as string).admin,
)
Joey
02/23/2022, 5:21 PMwithCapabilities
takes one (or more) permissions to check, and then places them into the props given to the pageJoey
02/23/2022, 5:22 PMJoey
02/23/2022, 5:23 PMJoey
02/23/2022, 5:23 PMAkshat
02/23/2022, 5:24 PMAkshat
02/23/2022, 5:26 PMJoey
02/23/2022, 5:26 PMJoey
02/23/2022, 5:26 PMJoey
02/23/2022, 5:26 PMAkshat
02/23/2022, 5:30 PMAkshat
02/23/2022, 5:31 PMAkshat
02/23/2022, 5:34 PMJoey
02/23/2022, 5:34 PMAkshat
02/23/2022, 5:34 PMAkshat
02/23/2022, 5:35 PMuser
02/23/2022, 8:44 PMCodeBreaker
02/23/2022, 8:47 PMluke
02/24/2022, 12:24 AMJoey
02/24/2022, 12:31 AMluke
02/24/2022, 12:31 AM