def get_role(self, item, state_root, from_state=False):
        """
        Used to retrieve an identity role.
        Args:
            item (string): the name of the role to be fetched
            state_root(string): The state root of the previous block.
            from_state (bool): Whether the identity value should be read
                directly from state, instead of using the cached values.
                This should be used when the state_root passed is not from
                the current chain head.
        """
        if from_state:
            # if from state use identity_view and do not add to cache
            if self._identity_view is None:
                self.update_view(state_root)
            value = self._identity_view.get_role(item)
            return value

        value = self._cache.get(item)
        if value is None:
            if self._identity_view is None:
                self.update_view(state_root)
            value = self._identity_view.get_role(item)
            self._cache[item] = value
        return value