Created a system to go directly to an assignment from a URL
This commit is contained in:
@@ -52,7 +52,8 @@ export const getServerSideProps = withIronSessionSsr(async ({req, res, params})
|
||||
const entity = await getEntityWithRoles(assignment.entity || "")
|
||||
if (!entity) return redirect("/assignments")
|
||||
|
||||
if (!doesEntityAllow(user, entity, 'view_assignments')) return redirect("/assignments")
|
||||
if (!doesEntityAllow(user, entity, 'view_assignments') && !["admin", "developer"].includes(user.type))
|
||||
return redirect("/assignments")
|
||||
|
||||
const users = await (checkAccess(user, ["developer", "admin"]) ? getUsers() : getEntityUsers(entity.id));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user