mirror of
https://github.com/lemeow125/Borrowing-TrackerFrontend.git
synced 2025-09-17 04:59:35 +08:00
Added student type to component and page restrictions
This commit is contained in:
parent
fce4725ff9
commit
be6e1ba229
2 changed files with 18 additions and 0 deletions
|
@ -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 <></>;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue