diff --git a/clirr-ignored-differences.xml b/clirr-ignored-differences.xml
new file mode 100644
index 00000000..da1f3c38
--- /dev/null
+++ b/clirr-ignored-differences.xml
@@ -0,0 +1,14 @@
+
+
+
+
+ com/google/cloud/resourcemanager/ResourceManager
+ java.util.Map testOrgPermissions(java.lang.String, java.util.List)
+ 7012
+
+
+ com/google/cloud/resourcemanager/spi/v1beta1/ResourceManagerRpc
+ java.util.Map testOrgPermissions(java.lang.String, java.util.List)
+ 7012
+
+
diff --git a/pom.xml b/pom.xml
index ba556b4b..7fa039a7 100644
--- a/pom.xml
+++ b/pom.xml
@@ -72,6 +72,7 @@
1.93.3
1.30.9
3.6
+ 1.10.19
2.6
0.20.0
1.34.2
@@ -205,6 +206,12 @@
+
+ org.mockito
+ mockito-all
+ ${mockito.version}
+ test
+
org.objenesis
objenesis
diff --git a/src/main/java/com/google/cloud/resourcemanager/ResourceManager.java b/src/main/java/com/google/cloud/resourcemanager/ResourceManager.java
index 9da15800..b2a46edf 100644
--- a/src/main/java/com/google/cloud/resourcemanager/ResourceManager.java
+++ b/src/main/java/com/google/cloud/resourcemanager/ResourceManager.java
@@ -24,6 +24,7 @@
import com.google.cloud.resourcemanager.spi.v1beta1.ResourceManagerRpc;
import com.google.common.collect.ImmutableList;
import java.util.List;
+import java.util.Map;
/**
* An interface for Google Cloud Resource Manager.
@@ -337,4 +338,20 @@ public static ProjectListOption fields(ProjectField... fields) {
* Platform Services
*/
List testPermissions(String projectId, List permissions);
+
+ /**
+ * Returns the permissions and their results representing whether the caller has the permissions
+ * on the specified Organization.
+ *
+ * @param resource the organization's resource name, e.g. "organizations/123"
+ * @param permissions the set of permissions to check for the resource. Permissions with wildcards
+ * (such as '*' or 'storage.*') are not allowed.
+ * @return the permissions and their results representing whether the caller has the permissions
+ * on the specified Organization.
+ * @throws ResourceManagerException upon failure
+ * @see
+ * Resource Manager testIamPermissions
+ */
+ Map testOrgPermissions(String resource, List permissions);
}
diff --git a/src/main/java/com/google/cloud/resourcemanager/ResourceManagerException.java b/src/main/java/com/google/cloud/resourcemanager/ResourceManagerException.java
index e8c7f8d0..cc820ee0 100644
--- a/src/main/java/com/google/cloud/resourcemanager/ResourceManagerException.java
+++ b/src/main/java/com/google/cloud/resourcemanager/ResourceManagerException.java
@@ -66,7 +66,7 @@ public ResourceManagerException(IOException exception) {
* @throws ResourceManagerException when {@code ex} was caused by a {@code
* ResourceManagerException}
*/
- static ResourceManagerException translateAndThrow(RetryHelperException ex) {
+ public static ResourceManagerException translateAndThrow(RetryHelperException ex) {
BaseServiceException.translate(ex);
throw new ResourceManagerException(UNKNOWN_CODE, ex.getMessage(), ex.getCause());
}
diff --git a/src/main/java/com/google/cloud/resourcemanager/ResourceManagerImpl.java b/src/main/java/com/google/cloud/resourcemanager/ResourceManagerImpl.java
index 7651e645..557567d9 100644
--- a/src/main/java/com/google/cloud/resourcemanager/ResourceManagerImpl.java
+++ b/src/main/java/com/google/cloud/resourcemanager/ResourceManagerImpl.java
@@ -32,6 +32,7 @@
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Iterables;
import com.google.common.collect.Maps;
+import java.io.IOException;
import java.util.List;
import java.util.Map;
import java.util.concurrent.Callable;
@@ -273,6 +274,25 @@ public List call() {
}
}
+ @Override
+ public Map testOrgPermissions(
+ final String resource, final List permissions) {
+ try {
+ return runWithRetries(
+ new Callable