use of com.google.gerrit.server.account.AccountResource.Capability in project gerrit by GerritCodeReview.
the class Capabilities method parse.
@Override
public Capability parse(AccountResource parent, IdString id) throws ResourceNotFoundException, AuthException, PermissionBackendException {
IdentifiedUser target = parent.getUser();
if (self.get() != target) {
permissionBackend.user(self).check(GlobalPermission.ADMINISTRATE_SERVER);
}
GlobalOrPluginPermission perm = parse(id);
if (permissionBackend.user(target).test(perm)) {
return new AccountResource.Capability(target, perm.permissionName());
}
throw new ResourceNotFoundException(id);
}
Aggregations