Caideyipi commented on code in PR #13158:
URL: https://github.com/apache/iotdb/pull/13158#discussion_r1753719851
##########
iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/auth/entity/PrivilegeUnin.java:
##########
@@ -0,0 +1,100 @@
+package org.apache.iotdb.commons.auth.entity;
+
+import org.apache.iotdb.commons.path.PartialPath;
+
+public class PrivilegeUnin {
+ private String dbname;
+ private String tbname;
+ private PartialPath path;
+
+ private boolean grantOption;
+ private final PrivilegeType privilegeType;
+
+ private final PrivilegeModelType modelType;
+
+ public PrivilegeUnin(String dbname, PrivilegeType type, boolean grantOption)
{
+ assert (type.isObjectPrivilege());
+ this.dbname = dbname;
+ this.privilegeType = type;
+ this.modelType = PrivilegeModelType.RELATIONAL;
+ this.grantOption = grantOption;
+ }
+
+ public PrivilegeUnin(String dbname, PrivilegeType type) {
+ assert (type.isObjectPrivilege());
+ this.dbname = dbname;
+ this.privilegeType = type;
+ this.modelType = PrivilegeModelType.RELATIONAL;
+ }
+
+ public PrivilegeUnin(String dbname, String tbname, PrivilegeType type,
boolean grantOption) {
+ assert (type.isObjectPrivilege());
+ this.dbname = dbname;
+ this.tbname = tbname;
+ this.privilegeType = type;
+ this.modelType = PrivilegeModelType.RELATIONAL;
+ this.grantOption = grantOption;
+ }
+
+ public PrivilegeUnin(String dbname, String tbname, PrivilegeType type) {
+ assert (type.isObjectPrivilege());
+ this.dbname = dbname;
+ this.tbname = tbname;
+ this.privilegeType = type;
+ this.modelType = PrivilegeModelType.RELATIONAL;
+ }
+
+ public PrivilegeUnin(PartialPath path, PrivilegeType type, boolean
grantOption) {
+ assert (type.isPathPrivilege());
+ this.path = path;
+ this.privilegeType = type;
+ this.modelType = PrivilegeModelType.TREE;
+ this.grantOption = grantOption;
+ }
+
+ public PrivilegeUnin(PartialPath path, PrivilegeType type) {
+ assert (type.isPathPrivilege());
+ this.path = path;
+ this.privilegeType = type;
+ this.modelType = PrivilegeModelType.TREE;
+ this.grantOption = false;
+ }
+
+ public PrivilegeUnin(PrivilegeType type, boolean grantOption) {
+ assert (type.isSystemPrivilege());
+ this.privilegeType = type;
+ this.modelType = PrivilegeModelType.SYSTEM;
+ this.grantOption = grantOption;
+ }
+
+ public PrivilegeUnin(PrivilegeType type) {
+ assert (type.isSystemPrivilege());
+ this.privilegeType = type;
+ this.modelType = PrivilegeModelType.SYSTEM;
+ this.grantOption = false;
+ }
+
+ public PrivilegeModelType ModelType() {
Review Comment:
use camelCase
##########
iotdb-protocol/thrift-confignode/src/main/thrift/confignode.thrift:
##########
@@ -373,9 +399,20 @@ struct TLoginReq {
struct TCheckUserPrivilegesReq {
1: required string username
- 2: required binary paths
- 3: required i32 permission
- 4: optional bool grantOpt
+ 2: required i32 reqtype
+ 3: optional binary paths
+ 4: optional string database
+ 5: optional string table
+ 6: required i32 permission
+ 7: required bool grantOpt
+}
+
+struct TCheckUserRelationalPrivilegesReq {
Review Comment:
Seems useless?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]