[Engine-patches] Change in ovirt-engine[master]: aaa: fixes to Authz utils
yzaslavs at redhat.com
yzaslavs at redhat.com
Wed May 21 11:16:28 UTC 2014
Yair Zaslavsky has uploaded a new change for review.
Change subject: aaa: fixes to Authz utils
......................................................................
aaa: fixes to Authz utils
Change-Id: Iceff3f7355219e1887f4e8736d78af94f6ab310e
Signed-off-by: Yair Zaslavsky <yzaslavs at redhat.com>
---
M backend/manager/modules/aaa/src/main/java/org/ovirt/engine/core/aaa/AuthzUtils.java
M backend/manager/modules/aaa/src/main/java/org/ovirt/engine/core/aaa/SearchQueryParsingUtils.java
2 files changed, 4 insertions(+), 5 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/67/27967/1
diff --git a/backend/manager/modules/aaa/src/main/java/org/ovirt/engine/core/aaa/AuthzUtils.java b/backend/manager/modules/aaa/src/main/java/org/ovirt/engine/core/aaa/AuthzUtils.java
index 57279f5..da3ed56 100644
--- a/backend/manager/modules/aaa/src/main/java/org/ovirt/engine/core/aaa/AuthzUtils.java
+++ b/backend/manager/modules/aaa/src/main/java/org/ovirt/engine/core/aaa/AuthzUtils.java
@@ -48,7 +48,7 @@
public static List<DirectoryUser> findPrincipalsByIds(final ExtensionProxy extension, final List<String> ids) {
List<DirectoryUser> results = new ArrayList<>();
- for (List<String> batch : SearchQueryParsingUtils.getIdsBatches(extension, ids)) {
+ for (List<String> batch : SearchQueryParsingUtils.getIdsBatches(extension.getContext(), ids)) {
results.addAll(
queryPrincipals(
extension,
@@ -76,7 +76,7 @@
public static List<DirectoryGroup> findGroupsByIds(final ExtensionProxy extension, final List<String> ids) {
List<DirectoryGroup> results = new ArrayList<>();
- for (List<String> batch : SearchQueryParsingUtils.getIdsBatches(extension, ids)) {
+ for (List<String> batch : SearchQueryParsingUtils.getIdsBatches(extension.getContext(), ids)) {
results.addAll(
queryGroups(
extension,
diff --git a/backend/manager/modules/aaa/src/main/java/org/ovirt/engine/core/aaa/SearchQueryParsingUtils.java b/backend/manager/modules/aaa/src/main/java/org/ovirt/engine/core/aaa/SearchQueryParsingUtils.java
index a4ac29e..67d9210 100644
--- a/backend/manager/modules/aaa/src/main/java/org/ovirt/engine/core/aaa/SearchQueryParsingUtils.java
+++ b/backend/manager/modules/aaa/src/main/java/org/ovirt/engine/core/aaa/SearchQueryParsingUtils.java
@@ -12,7 +12,6 @@
import org.ovirt.engine.api.extensions.aaa.Authz;
import org.ovirt.engine.api.extensions.aaa.Authz.QueryFilterOperator;
import org.ovirt.engine.api.extensions.aaa.Authz.QueryFilterRecord;
-import org.ovirt.engine.core.extensions.mgr.ExtensionProxy;
/**
* This class is a helper class to transform searchbackend related search queries to Extension API structures. This
@@ -128,9 +127,9 @@
return queryPrefix;
}
- public static List<List<String>> getIdsBatches(final ExtensionProxy extension, final List<String> ids) {
+ public static List<List<String>> getIdsBatches(final ExtMap context, final List<String> ids) {
- int chunk = extension.getContext().<Integer> get(Authz.ContextKeys.QUERY_MAX_FILTER_SIZE, 100) - 10;
+ int chunk = context.<Integer> get(Authz.ContextKeys.QUERY_MAX_FILTER_SIZE, 100) - 10;
List<List<String>> batchOfIdsList = new ArrayList<>();
for (int counter = 0; counter < ids.size(); counter = counter + chunk) {
batchOfIdsList.add(ids.subList(counter, counter + chunk > ids.size() ? ids.size() : counter + chunk));
--
To view, visit http://gerrit.ovirt.org/27967
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iceff3f7355219e1887f4e8736d78af94f6ab310e
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Yair Zaslavsky <yzaslavs at redhat.com>
More information about the Engine-patches
mailing list