h6. What We should create a function that can be called to check if a user has a given role.
h6. Why This can be used in access control decisions to allow certain UI components or functions to be called based on the users role.
h6. How Create a function that takes in a role name in string Role format, and returns a boolean based on whether or not the user has the specified role. [ Similar Example for Realm Roles code|https://github.com/feedhenry/mobile-security-android-template/blob/c7e6646e5bbcfb8206822b0148eb1ab6d047f5cb/app/src/main/java/com/feedhenry/securenativeandroidtemplate/domain/services/AuthStateService.java#L146-L164].
Note: This should probably be 2 different methods: hasRealmRole(String role) and hasClientRole(String role). |
|