useUserGroups

Overview

Custom hook that provides a number of functions that allow for user group determination

Example : Default usage
import { useUserGroups } from '@ska-telescope/ska-login-page';
Available functions

Function

Notes

allGroups

All groups associated to the token

hasGroup: (group: BaseGroup)

return true if the provided base role is present

hasAnyGroup: (…groups: BaseGroup[])

return true if any of the provided groups are present

hasAllGroups: (…groups: BaseGroup[])

return true if all of the provided groups are present