mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-13 13:07:32 +00:00
(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:
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user