(self, permission, user=None, group=None, check_group=True)
return ace
Get the specific access control entry for the user and permission.

        Args:
            permission: Permission as string (read, write or delete)
            user: A user (Instance of timesketch.models.user.User)
            group: A group (Instance of timesketch.models.user.Group)
            check_group: Check group permission, default is True.

        Returns:
            An ACE (instance of timesketch.models.acl.AccessControlEntry) or
            None if no ACE is found.
Get the specific access control entry for the user and permission.
Get the specific access control entry for the user and permission .
def _get_ace(self, permission, user=None, group=None, check_group=True):
        """Get the specific access control entry for the user and permission.

        Args:
            permission: Permission as string (read, write or delete)
            user: A user (Instance of timesketch.models.user.User)
            group: A group (Instance of timesketch.models.user.Group)
            check_group: Check group permission, default is True.

        Returns:
            An ACE (instance of timesketch.models.acl.AccessControlEntry) or
            None if no ACE is found.
        """
        # If group is specified check if an ACE exist for it and return early.
        if group:
            return self.AccessControlEntry.query.filter_by(
                group=group, permission=permission, parent=self).all()

        # Check access for user.
        ace = self.AccessControlEntry.query.filter_by(
            user=user, group=None, permission=permission, parent=self).all()

        # If user doesn't have a direct ACE, check group permission.
        if (user and check_group) and not ace:
            group_intersection = set(user.groups) & set(self.groups)
            for _group in group_intersection:
                # Get group ACE with the requested permission.
                ace = self.AccessControlEntry.query.filter_by(
                    group=_group, permission=permission, parent=self).all()
                if ace:
                    return ace
        return ace
def _get_ace ( self , permission , user = None , group = None , check_group = True ) : # If group is specified check if an ACE exist for it and return early. if group : return self . AccessControlEntry . query . filter_by ( group = group , permission = permission , parent = self ) . all ( ) # Check access for user. ace = self . AccessControlEntry . query . filter_by ( user = user , group = None , permission = permission , parent = self ) . all ( ) # If user doesn't have a direct ACE, check group permission. if ( user and check_group ) and not ace : group_intersection = set ( user . groups ) & set ( self . groups ) for _group in group_intersection : # Get group ACE with the requested permission. ace = self . AccessControlEntry . query . filter_by ( group = _group , permission = permission , parent = self ) . all ( ) if ace : return ace return ace