'Return user resources in a dict format.'

def as_dict(self):

    def _as_dict(level):
        tmp = {}
        for (k, v) in iter(level.items()):
            if isinstance(v, dict):
                tmp[k] = _as_dict(v)
            elif (is_hook_definition(k, v) or is_valid_restricted_action(k, v)):
                tmp[k] = v
            elif v.user_resource:
                tmp[k] = v.value
        return tmp
    return _as_dict(self._registry)
