Created
February 28, 2017 21:25
-
-
Save captainkovalsky/d86feee375c02aab41e4a9191888a4eb to your computer and use it in GitHub Desktop.
This file contains 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
var hasPermission = function hasPermission(permission) { | |
var mockUser = { | |
role: 'ADMIN' | |
}; | |
var rolePermissions = { | |
'ADMIN': ['viewEmail'], | |
'ADMIN2': ['editEmail'] | |
}; | |
return rolePermissions[mockUser.role].indexOf(permission) !== -1; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment