Created
July 18, 2018 09:34
-
-
Save abel-masila/6148bda88b92c040053f6a7844a6f3be to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const getUserRole = () => { | |
const storage = getItemFromStorage(KEY); | |
const user_roles = { | |
roles: '' | |
}; | |
if (!storage) { | |
user_roles.roles = null; | |
} | |
for (const key in user_roles) { | |
user_roles.roles = storage.currentUser.user_roles; | |
const value = user_roles[key]; | |
user_roles[key] = eval(value); | |
} | |
return user_roles.roles.filter(o => o == "super_admin").length > 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment