Last active
October 13, 2022 05:34
-
-
Save saravanapriyanm/264ccac8d533033f0a5dc74890ca8190 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
enum Claims { | |
viewPage1 = 1<<0, | |
editPage1 = 1<<1, | |
approvePage1 = 1<<2, | |
viewPage2 = 1<<3, | |
editPage2 = 1<<4, | |
approvePage2 = 1<<5, | |
} | |
const dashboardBuilder = Claims.viewPage1 + Claims.editPage1 + Claims.approvePage1; | |
console.log((dashboardBuilder & Claims.editPage1) === Claims.editPage1); | |
console.log((dashboardBuilder & Claims.approvePage2) === Claims.approvePage2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment