Added student type to component and page restrictions

This commit is contained in:
Keannu Christian Bernasol 2023-12-14 18:08:27 +08:00
parent fce4725ff9
commit be6e1ba229
2 changed files with 18 additions and 0 deletions

View file

@ -33,6 +33,10 @@ export default function RestrictedComponent(props: props) {
if (user.data && user.data.is_technician) {
return <>{props.children}</>;
}
} else if (props.allow_only === "Student") {
if (user.data && !user.data.is_technician && !user.data.is_teacher) {
return <>{props.children}</>;
}
}
return <></>;
}