use demo role to show/hide features

This commit is contained in:
Alex Holliday committed 2024-09-06 11:51:55 -07:00
1 parent 63da8bd571
commit 7f9950b9e5
5 files changed
+16 -13

No files matched your search

+5 -3
View File
@@ -24,9 +24,11 @@ const Account = ({ open = "profile" }) => {
};
const { user } = useSelector((state) => state.auth);
let tabList = ["Profile", "Team"];
if (user.role.includes("superadmin")) {
tabList.push("Password");
let tabList = ["Profile", "Team", "Password"];
// Remove passwrod for demo
if (user.role.includes("demo")) {
tabList = tabList.filter((tab) => tab !== "Password");
}
const requiredRoles = ["superadmin", "admin"];
const hideTeams = !requiredRoles.some((role) => user.role.includes(role));