Disable capability endpoints when not using default backend

The capability names exposed by these endpoints are implementation
details of the DefaultPermissionBackend. A different implementation may
choose to hide the GlobalPermission enum names from the user entirely,
so it doesn't make sense to expose them.

Change-Id: I69ea38064ccbf1c04a976e7bcb4629ab5d66aeef
This commit is contained in:
Dave Borowitz
2018-04-11 10:27:36 +02:00
parent 0a5f646bd8
commit cc4d1ac051
6 changed files with 79 additions and 5 deletions

View File

@@ -84,6 +84,11 @@ public class DefaultPermissionBackend extends PermissionBackend {
return new WithUserImpl(identifiedUser);
}
@Override
public boolean usesDefaultCapabilities() {
return true;
}
class WithUserImpl extends WithUser {
private final CurrentUser user;
private Boolean admin;