(cls, user=None)
return cls.query.filter(
            or_(cls.AccessControlEntry.user == user,
                and_(cls.AccessControlEntry.user == None,
                     cls.AccessControlEntry.group == None),
                cls.AccessControlEntry.group_id.in_([
                    group.id for group in user.groups
                ])), cls.AccessControlEntry.permission == 'read',
            cls.AccessControlEntry.parent)
Get all instances of the parent class that the user has read
        permission on. I.e enforce ACL permission check when fetching from
        the database.

        Args:
            user: A user (Instance of timesketch.models.user.User)

        Returns:
            An ACL base query (instance of timesketch.models.AclBaseQuery)
Get all instances of the parent class that the user has read
        permission on. I.e enforce ACL permission check when fetching from
        the database.
Get all instances of the parent class that the user has read permission on . I . e enforce ACL permission check when fetching from the database .
def all_with_acl(cls, user=None):
        """
        Get all instances of the parent class that the user has read
        permission on. I.e enforce ACL permission check when fetching from
        the database.

        Args:
            user: A user (Instance of timesketch.models.user.User)

        Returns:
            An ACL base query (instance of timesketch.models.AclBaseQuery)
        """
        # If no user, assume the user that made the request.
        if not user:
            user = current_user

        # pylint: disable=singleton-comparison
        return cls.query.filter(
            or_(cls.AccessControlEntry.user == user,
                and_(cls.AccessControlEntry.user == None,
                     cls.AccessControlEntry.group == None),
                cls.AccessControlEntry.group_id.in_([
                    group.id for group in user.groups
                ])), cls.AccessControlEntry.permission == 'read',
            cls.AccessControlEntry.parent)
def all_with_acl ( cls , user = None ) : # If no user, assume the user that made the request. if not user : user = current_user # pylint: disable=singleton-comparison return cls . query . filter ( or_ ( cls . AccessControlEntry . user == user , and_ ( cls . AccessControlEntry . user == None , cls . AccessControlEntry . group == None ) , cls . AccessControlEntry . group_id . in_ ( [ group . id for group in user . groups ] ) ) , cls . AccessControlEntry . permission == 'read' , cls . AccessControlEntry . parent )