def countFolders(self, user, filterUser=None, level=None):
        fields = () if level is None else ('access', 'public')

        folderModel = self.model('folder')
        folders = folderModel.find({
            'parentId': user['_id'],
            'parentCollection': 'user'
        }, fields=fields)

        if level is None:
            return folders.count()
        else:
            return sum(1 for _ in folderModel.filterResultsByPermission(
                cursor=folders, user=filterUser, level=level))
Returns the number of top level folders under this user. Access
dataset/ETHPy150Open girder/girder/girder/models/user.py/User.countFolders