13 lines
322 B
JavaScript
13 lines
322 B
JavaScript
import { useProfile } from "../hooks/useProfile";
|
|
|
|
export const hasUserPermission = (permission) => {
|
|
const { profile } = useProfile();
|
|
if (profile) {
|
|
if (!permission || typeof permission !== "string") {
|
|
return false;
|
|
}
|
|
return profile?.featurePermissions.includes(permission);
|
|
}
|
|
return false;
|
|
};
|