Alon Bar-Lev has posted comments on this change.

Change subject: aaa: Fix sync
......................................................................


Patch Set 13:

I try to outline the algorithm to return a list of principal records complete 
hierarchy group resolved based on authz interaction only without db entities, 
and with known entities of PrincipalRecord and GroupRecord, this will enable us 
to talk at same language and have simple algorithm. The wrapper should convert 
from and to db entities.

 Input: Map<Authz, List<Id>>
 Output: Map<Authz, PrincipalRecord>

Logic:

 Map<Authz, PrincipalRecord> ret = new ...
 for each authz:
     List<PrincipalRecord> principals = getPrincipal(ids, 
resolve_groups_non_recursive)
     ret.put(authz, principals)
     toResolveGroups = empty_list

     // add groups of principal to be resolved
     for each principal:
         toResolveGroups.add(principal.groups)

     resolvedGroups = empty_list
     // until we resolved all groups
     while !toResolveGroups.isEmpty():
         toResolveGroups = empty_list
         // fetch unresolved groups
         List<GroupRecord> groups = fetchGroups(toResolveGroups)
         // go over all groups that not already resolved
         for group in groups - resolvedGroups:
             // replace all group records within the principal tree
             // with the resolved one, based on group id
             // this is not optimized, but we will handle that
             // in future, the outcome is that we have
             // the resolved group every place
             recursive_replace_groups_by_id(principals, group)
             resolvedGroups.add(group)
             toResolveGroups.add(group.groups)

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

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

Reply via email to