Skip to content

Commit 87bbb4b

Browse files
committed
missing-fix
1 parent fd352ce commit 87bbb4b

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/source/schemaregion/IoTDBSchemaRegionSource.java

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919

2020
package org.apache.iotdb.db.pipe.source.schemaregion;
2121

22+
import org.apache.iotdb.commons.auth.entity.PrivilegeType;
23+
import org.apache.iotdb.commons.conf.IoTDBConstant;
2224
import org.apache.iotdb.commons.consensus.SchemaRegionId;
2325
import org.apache.iotdb.commons.exception.IllegalPathException;
2426
import org.apache.iotdb.commons.exception.auth.AccessDeniedException;
@@ -53,9 +55,13 @@
5355
import org.apache.iotdb.pipe.api.customizer.configuration.PipeExtractorRuntimeConfiguration;
5456
import org.apache.iotdb.pipe.api.customizer.parameter.PipeParameters;
5557
import org.apache.iotdb.pipe.api.exception.PipeException;
58+
import org.apache.iotdb.rpc.TSStatusCode;
59+
60+
import org.apache.tsfile.common.constant.TsFileConstant;
5661

5762
import java.io.IOException;
5863
import java.nio.file.Paths;
64+
import java.util.Collections;
5965
import java.util.HashSet;
6066
import java.util.Objects;
6167
import java.util.Optional;
@@ -167,9 +173,20 @@ protected boolean canSkipSnapshotPrivilegeCheck(final PipeSnapshotEvent event) {
167173
if (PathUtils.isTableModelDatabase(database)) {
168174
AuthorityChecker.getAccessControl()
169175
.checkCanSelectFromDatabase4Pipe(userName, database, userEntity);
176+
return true;
170177
}
171-
return true;
172-
} catch (final AccessDeniedException e) {
178+
return AuthorityChecker.getAccessControl()
179+
.checkSeriesPrivilege4Pipe(
180+
userEntity,
181+
Collections.singletonList(
182+
new PartialPath(
183+
database
184+
+ TsFileConstant.PATH_SEPARATOR
185+
+ IoTDBConstant.MULTI_LEVEL_PATH_WILDCARD)),
186+
PrivilegeType.READ_SCHEMA)
187+
.getCode()
188+
== TSStatusCode.SUCCESS_STATUS.getStatusCode();
189+
} catch (final AccessDeniedException | IllegalPathException e) {
173190
return false;
174191
}
175192
}

0 commit comments

Comments
 (0)