def hasAccess(self, doc, user=None, level=AccessType.READ):
        if user is None:
            # Short-circuit the case of anonymous users
            return level == AccessType.READ and doc.get('public', False) is True
        elif user.get('admin', False) is True:
            # Short-circuit the case of admins
            return True
        elif level == AccessType.READ:
            # For read access, just check user document for membership or public
            return doc.get('public', False) is True or\
                doc['_id'] in user.get('groups', []) or\
                doc['_id'] in [i['groupId'] for i in
                               user.get('groupInvites', [])]
        else:
            # Check the actual permissions document for >=WRITE access
            return self._hasUserAccess(doc.get('access', {}).get('users', []),
                                       user['_id'], level)
This overrides the default AccessControlledModel behavior for checking
dataset/ETHPy150Open girder/girder/girder/models/group.py/Group.hasAccess