updates to user roles

This commit is contained in:
Henry Dollman
2024-07-17 12:14:07 -04:00
parent 8b09b5092e
commit fe110b1175
8 changed files with 59 additions and 40 deletions

View File

@@ -75,7 +75,9 @@ export const formatDay = (timestamp: string) => {
export const updateFavicon = (newIconUrl: string) =>
((document.querySelector("link[rel='icon']") as HTMLLinkElement).href = newIconUrl)
export const isAdmin = () => pb.authStore.model?.admin
export const isAdmin = () => pb.authStore.model?.role === 'admin'
export const isReadOnlyUser = () => pb.authStore.model?.role === 'readonly'
// export const isDefaultUser = () => pb.authStore.model?.role === 'user'
/** Update systems / alerts list when records change */
export function updateRecordList<T extends RecordModel>(