@Test
  public void manageUdfTest() {
    assertNonQueryTestFail(
        "create function counter as 'org.apache.iotdb.db.query.udf.example.Counter'",
        "803: No permissions for this operation, please add privilege USE_UDF",
        "test",
        "test123");
    assertNonQueryTestFail(
        "drop function counter",
        "803: No permissions for this operation, please add privilege USE_UDF",
        "test",
        "test123");
    assertTestFail(
        "show functions",
        "803: No permissions for this operation, please add privilege USE_UDF",
        "test",
        "test123");

    grantUserSystemPrivileges("test", PrivilegeType.USE_UDF);

    executeNonQuery(
        "create function counter as 'org.apache.iotdb.db.query.udf.example.Counter'",
        "test",
        "test123");
    executeNonQuery("drop function counter", "test", "test123");
    executeQuery("show functions", "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/IoTDBSystemPermissionIT.java