(improvement)(auth) Make row permissions take effect during the translate sql phase and refactor the auth code (#1368)

Co-authored-by: lxwcodemonkey
This commit is contained in:
LXW
2024-07-07 20:46:53 +08:00
committed by GitHub
parent 08ae27ab43
commit 9911e6772c
10 changed files with 163 additions and 456 deletions

View File

@@ -9,7 +9,9 @@ import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import static com.tencent.supersonic.common.pojo.Constants.UNDERLINE;
@@ -58,4 +60,20 @@ public class SemanticSchemaResp {
.findFirst().orElse(null);
}
public Set<String> getNameFromBizNames(Set<String> bizNames) {
Set<String> names = new HashSet<>();
for (String bizName : bizNames) {
DimSchemaResp dimSchemaResp = getDimension(bizName);
if (dimSchemaResp != null) {
names.add(dimSchemaResp.getName());
continue;
}
MetricSchemaResp metricSchemaResp = getMetric(bizName);
if (metricSchemaResp != null) {
names.add(metricSchemaResp.getName());
}
}
return names;
}
}