def can_with_record(self, user, action, record: DataRecord, *, available=None):
assert action not in (A.QUERY, A.CREATE), "<STR_LIT>" % action<EOL>rules = []<EOL>for rule in self.record_checks:<EOL><INDENT>if record.table == rule[<NUM_LIT:0>] and action in rule[<NUM_LIT:1>]:<EOL><INDENT>rules.append(rule)<EOL><DEDENT><DEDENT>if available is None: available = self.can_with_columns(user, action, record.table, record.keys())<EOL>else: available = list(available)<EOL>bak = available.copy()<EOL>for rule in rules:<EOL><INDENT>ret = rule[-<NUM_LIT:1>](self, user, action, record, available)<EOL>if isinstance(ret, (tuple, set, list)):<EOL><INDENT>available = list(ret)<EOL><DEDENT>elif ret == '<STR_LIT:*>':<EOL><INDENT>available = list(bak)<EOL><DEDENT>elif not ret:<EOL><INDENT>available = []<EOL><DEDENT><DEDENT>return available<EOL>
进行基于 Record 的权限判定，返回可用列。
:param user:
:param action:
:param record:
:param available: 限定检查范围
:return: 可用列