public static int getPrivilegeCount(PrivilegeModelType type) {
    int size = 0;
    for (PrivilegeType item : PrivilegeType.values()) {
      switch (type) {
        case TREE:
          size += item.isPathPrivilege() ? 1 : 0;
          break;
        case SYSTEM:
          size += item.isSystemPrivilege() ? 1 : 0;
          break;
        case RELATIONAL:
          size += item.isRelationalPrivilege() ? 1 : 0;
          break;
        default:
          break;
      }
    }
    return size;
  }
This enum class contains all available privileges in IoTDB.
iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/auth/entity/PrivilegeType.java