Alon Bar-Lev has posted comments on this change.

Change subject: aaa: sync: handle group loops
......................................................................


Patch Set 1:

(2 comments)

http://gerrit.ovirt.org/#/c/35663/1/backend/manager/modules/aaa/src/main/java/org/ovirt/engine/core/aaa/AuthzUtils.java
File 
backend/manager/modules/aaa/src/main/java/org/ovirt/engine/core/aaa/AuthzUtils.java:

Line 120: 
Line 121:     private static ExtMap constructGroupsMembershipTree(ExtMap 
entity, ExtKey key, Map<String, ExtMap> groupsCache, Deque<String> 
loopPrevention) {
Line 122:         List<ExtMap> groups = new ArrayList<>();
Line 123:         for (ExtMap memberOf : entity.get(key, Collections.<ExtMap> 
emptyList())) {
Line 124:             if 
(loopPrevention.contains(memberOf.get(GroupRecord.ID))) {
> you're taking the ID in this method about 3 times, so better have it at the
I do not like to use temp variables if the object exists, just like of you have 
person.getName() you do not optimize it.
Line 125:                 log.error(
Line 126:                     "Group recursion detected for group '{}' stack is 
{}",
Line 127:                     memberOf.get(GroupRecord.NAME),
Line 128:                     loopPrevention


Line 136:                         groupsCache,
Line 137:                         loopPrevention
Line 138:                     )
Line 139:                 );
Line 140:                 loopPrevention.pop();
> can't the same group (GroupRecord.ID) appear later on, when moving to the n
I do not understand... we need to keep track of the stack level, and to use 
this a stack is appropriate.
Line 141:             }
Line 142:         }
Line 143:         entity.put(key, groups);
Line 144:         return entity;


-- 
To view, visit http://gerrit.ovirt.org/35663
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ie90ad3cbef9675be8c0ceba47c22609a9985b518
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Alon Bar-Lev <alo...@redhat.com>
Gerrit-Reviewer: Alon Bar-Lev <alo...@redhat.com>
Gerrit-Reviewer: Oved Ourfali <oourf...@redhat.com>
Gerrit-Reviewer: Yair Zaslavsky <yzasl...@redhat.com>
Gerrit-Reviewer: automat...@ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to