Exemplo n.º 1
0
 public static void update(AccessGroup accessGroup, Policy policy) {
   accessGroup.setId(policy.getId());
   accessGroup.setGroup(policy.getAuthId());
   accessGroup.setDefault(false);
   accessGroup.getAccess().clear();
   for (String apiId : policy.getApiIds()) {
     Access access = new Access();
     accessGroup.getAccess().add(access);
     access.setId(apiId);
   }
 }
Exemplo n.º 2
0
 public static void update(AccessGroup accessGroup, Map<String, Api> apisById) {
   Iterator<Access> iterator = accessGroup.getAccess().iterator();
   while (iterator.hasNext()) {
     Access access = iterator.next();
     Api api = apisById.get(access.getId());
     if (api == null) {
       iterator.remove();
       continue;
     }
     update(access, api);
   }
 }