File tree Expand file tree Collapse file tree 6 files changed +2
-63
lines changed
gcloud-java-resourcemanager/src
main/java/com/google/gcloud/resourcemanager
test/java/com/google/gcloud/resourcemanager Expand file tree Collapse file tree 6 files changed +2
-63
lines changed Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ public class Policy extends IamPolicy<String> {
47
47
/**
48
48
* The project-level roles in an IAM policy. This enum is not an exhaustive list of all roles
49
49
* you can use in an IAM policy. You can also use service-specific roles (e.g.
50
- * <i> roles/pubsub.editor</i> ). See the <i>Supported Cloud Platform Services</i> page for links
50
+ * " roles/pubsub.editor" ). See the <i>Supported Cloud Platform Services</i> page for links
51
51
* to service-specific roles.
52
52
*
53
53
* @see <a href="https://cloud.google.com/iam/#supported_cloud_platform_services">Supported Cloud
@@ -74,7 +74,7 @@ public enum ProjectRole {
74
74
*/
75
75
OWNER ("roles/owner" );
76
76
77
- String value ;
77
+ private final String value ;
78
78
79
79
private ProjectRole (String value ) {
80
80
this .value = value ;
Original file line number Diff line number Diff line change @@ -251,29 +251,6 @@ List<Boolean> testPermissions(List<String> permissions) {
251
251
return resourceManager .testPermissions (projectId (), permissions );
252
252
}
253
253
254
- /**
255
- * Returns the permissions that a caller has on this project. You typically don't call this method
256
- * if you're using Google Cloud Platform directly to manage permissions. This method is intended
257
- * for integration with your proprietary software, such as a customized graphical user interface.
258
- * For example, the Cloud Platform Console tests IAM permissions internally to determine which UI
259
- * should be available to the logged-in user. Each service that supports IAM lists the possible
260
- * permissions; see the <i>Supported Cloud Platform services</i> page below for links to these
261
- * lists.
262
- *
263
- * @return a list of booleans representing whether the caller has the permissions specified (in
264
- * the order of the given permissions)
265
- * @throws ResourceManagerException upon failure
266
- * @see <a href=
267
- * "https://cloud.google.com/resource-manager/reference/rest/v1beta1/projects/testIamPermissions">
268
- * Resource Manager testIamPermissions</a>
269
- * @see <a href=
270
- * "https://cloud.google.com/iam/#supported_cloud_platform_services">Supported Cloud Platform
271
- * Services</a>
272
- */
273
- List <Boolean > testPermissions (String firstPermission , String ... otherPermissions ) {
274
- return resourceManager .testPermissions (projectId (), firstPermission , otherPermissions );
275
- }
276
-
277
254
@ Override
278
255
public Builder toBuilder () {
279
256
return new Builder (this );
Original file line number Diff line number Diff line change @@ -341,26 +341,4 @@ public static ProjectListOption fields(ProjectField... fields) {
341
341
* Services</a>
342
342
*/
343
343
List <Boolean > testPermissions (String projectId , List <String > permissions );
344
-
345
- /**
346
- * Returns the permissions that a caller has on the specified project. You typically don't call
347
- * this method if you're using Google Cloud Platform directly to manage permissions. This method
348
- * is intended for integration with your proprietary software, such as a customized graphical user
349
- * interface. For example, the Cloud Platform Console tests IAM permissions internally to
350
- * determine which UI should be available to the logged-in user. Each service that supports IAM
351
- * lists the possible permissions; see the <i>Supported Cloud Platform services</i> page below for
352
- * links to these lists.
353
- *
354
- * @return A list of booleans representing whether the caller has the permissions specified (in
355
- * the order of the given permissions)
356
- * @throws ResourceManagerException upon failure
357
- * @see <a href=
358
- * "https://cloud.google.com/resource-manager/reference/rest/v1beta1/projects/testIamPermissions">
359
- * Resource Manager testIamPermissions</a>
360
- * @see <a href=
361
- * "https://cloud.google.com/iam/#supported_cloud_platform_services">Supported Cloud Platform
362
- * Services</a>
363
- */
364
- List <Boolean > testPermissions (
365
- String projectId , String firstPermission , String ... otherPermissions );
366
344
}
Original file line number Diff line number Diff line change 23
23
import com .google .common .collect .ImmutableList ;
24
24
import com .google .common .collect .ImmutableMap ;
25
25
import com .google .common .collect .Iterables ;
26
- import com .google .common .collect .Lists ;
27
26
import com .google .common .collect .Maps ;
28
27
import com .google .gcloud .BaseService ;
29
28
import com .google .gcloud .Page ;
@@ -230,12 +229,6 @@ public List<Boolean> call() {
230
229
}
231
230
}
232
231
233
- @ Override
234
- public List <Boolean > testPermissions (
235
- String projectId , String firstPermission , String ... otherPermissions ) {
236
- return testPermissions (projectId , Lists .asList (firstPermission , otherPermissions ));
237
- }
238
-
239
232
private Map <ResourceManagerRpc .Option , ?> optionMap (Option ... options ) {
240
233
Map <ResourceManagerRpc .Option , Object > temp = Maps .newEnumMap (ResourceManagerRpc .Option .class );
241
234
for (Option option : options ) {
Original file line number Diff line number Diff line change @@ -240,14 +240,11 @@ public void testTestPermissions() {
240
240
String getPermission = "resourcemanager.projects.get" ;
241
241
String deletePermission = "resourcemanager.projects.delete" ;
242
242
expect (resourceManager .options ()).andReturn (mockOptions ).times (1 );
243
- expect (resourceManager .testPermissions (PROJECT_ID , getPermission , deletePermission ))
244
- .andReturn (response );
245
243
expect (resourceManager .testPermissions (
246
244
PROJECT_ID , ImmutableList .of (getPermission , deletePermission )))
247
245
.andReturn (response );
248
246
replay (resourceManager );
249
247
initializeProject ();
250
- assertEquals (response , project .testPermissions (getPermission , deletePermission ));
251
248
assertEquals (
252
249
response , project .testPermissions (ImmutableList .of (getPermission , deletePermission )));
253
250
}
Original file line number Diff line number Diff line change @@ -381,12 +381,6 @@ public void testTestPermissions() {
381
381
RESOURCE_MANAGER .create (PARTIAL_PROJECT );
382
382
assertEquals (ImmutableList .of (true ),
383
383
RESOURCE_MANAGER .testPermissions (PARTIAL_PROJECT .projectId (), permissions ));
384
- assertEquals (
385
- ImmutableList .of (true , true ),
386
- RESOURCE_MANAGER .testPermissions (
387
- PARTIAL_PROJECT .projectId (),
388
- "resourcemanager.projects.delete" ,
389
- "resourcemanager.projects.get" ));
390
384
}
391
385
392
386
@ Test
You can’t perform that action at this time.
0 commit comments