fix: faculty users are now recognized as employees
This commit is contained in:
@@ -3,16 +3,16 @@ import {
|
||||
makePartials,
|
||||
} from "$root/defaults/makePartials.tsx";
|
||||
import { FreshContext } from "$fresh/server.ts";
|
||||
import { State } from "$root/defaults/interfaces.ts";
|
||||
import { isEmployee, State } from "$root/defaults/interfaces.ts";
|
||||
|
||||
// deno-lint-ignore require-await
|
||||
export async function Index(
|
||||
_request: Request,
|
||||
context: FreshContext<State>,
|
||||
) {
|
||||
const isEmployee =
|
||||
(context.state as unknown as { session: Record<string, string> }).session
|
||||
.eduPersonPrimaryAffiliation === "employee";
|
||||
const employeeCheck = isEmployee(
|
||||
(context.state as unknown as { session: Record<string, string> }).session,
|
||||
);
|
||||
|
||||
return (
|
||||
<div class="page-content">
|
||||
@@ -25,7 +25,7 @@ export async function Index(
|
||||
</strong>
|
||||
.
|
||||
</p>
|
||||
{isEmployee
|
||||
{employeeCheck
|
||||
? (
|
||||
<p>
|
||||
Consultez les{" "}
|
||||
|
||||
Reference in New Issue
Block a user