@Test
  public void otherTest() {
    executeNonQuery(
        "create device template t1 (temperature FLOAT encoding=RLE, status BOOLEAN encoding=PLAIN compression=SNAPPY)");
    executeNonQuery("create database root.sg1");
    executeNonQuery("set device template t1 to root.sg1.d1");

    // active
    assertNonQueryTestFail(
        "create timeseries using device template on root.sg1.d1",
        "803: No permissions for this operation, please add privilege WRITE_SCHEMA on [root.sg1.d1.temperature, root.sg1.d1.status]",
        "test",
        "test123");
    grantUserSeriesPrivilege("test", PrivilegeType.WRITE_SCHEMA, "root.sg1.d1.**");
    executeNonQuery("create timeseries using device template on root.sg1.d1", "test", "test123");

    // insert
    assertNonQueryTestFail(
        "insert into root.sg1.d1(time, s1) values(1,1)",
        "803: No permissions for this operation, please add privilege WRITE_DATA on [root.sg1.d1.s1]",
        "test",
        "test123");
    grantUserSeriesPrivilege("test", PrivilegeType.WRITE_DATA, "root.sg1.**");
    executeNonQuery("insert into root.sg1.d1(time, temperature) values(1,1)", "test", "test123");
    assertNonQueryTestFail(
        "insert into root.sg1.d1(time, s1) values(1,1)",
        "803: No permissions for this operation, please add privilege EXTEND_TEMPLATE",
        "test",
        "test123");
    grantUserSeriesPrivilege("test", PrivilegeType.EXTEND_TEMPLATE, "root.**");
    executeNonQuery("insert into root.sg1.d1(time, s1) values(1,1)", "test", "test123");

    // show
    executeNonQuery("create database root.sg2");
    executeNonQuery("set device template t1 to root.sg2.d1");
    resultSetEqualTest(
        "show paths using device template t1",
        showPathsUsingTemplateHeaders.stream()
            .map(ColumnHeader::getColumnName)
            .toArray(String[]::new),
        new String[] {"root.sg1.d1,"},
        "test",
        "test123");

    // deActive
    revokeUserSeriesPrivilege("test", PrivilegeType.WRITE_SCHEMA, "root.sg1.d1.**");
    assertNonQueryTestFail(
        "deactivate device template t1 from root.sg1.d1",
        "803: No permissions for this operation, please add privilege WRITE_SCHEMA on [root.sg1.d1.temperature, root.sg1.d1.s1, root.sg1.d1.status]",
        "test",
        "test123");
    grantUserSeriesPrivilege("test", PrivilegeType.WRITE_SCHEMA, "root.sg1.d1.**");
    executeNonQuery("deactivate device template t1 from root.sg1.d1", "test", "test123");
  }
This Class contains integration tests for SystemPermissions but {@link PrivilegeType#MANAGE_USER}
and {@link PrivilegeType#MANAGE_ROLE}, you can see tests of them in {@link IoTDBAuthIT}.
integration-test/src/test/java/org/apache/iotdb/db/it/auth/IoTDBTemplatePermissionIT.java