use demo role to show/hide features
This commit is contained in:
1 parent
63da8bd571
commit
7f9950b9e5
5 files changed
+16
-13
No files matched your search
@@ -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));
|
||||
|
||||
Reference in new issue
Block a user