301. EPMO Open Source Coordination Office Redaction File Detail Report

Produced by Araxis Merge on 6/11/2019 10:54:16 AM Eastern Daylight Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.

301.1 Files compared

# Location File Last Modified
1 HTRE_P3_v14.5_iter_4_build_14.zip\java\gov\va\med\fw\service\ldap LdapPersonServiceImpl.java Wed May 29 15:26:30 2019 UTC
2 HTRE_P3_v14.5_iter_4_build_14.zip\java\gov\va\med\fw\service\ldap LdapPersonServiceImpl.java Tue Jun 11 11:39:49 2019 UTC

301.2 Comparison summary

Description Between
Files 1 and 2
Text Blocks Lines
Unchanged 2 222
Changed 1 2
Inserted 0 0
Removed 0 0

301.3 Comparison options

Whitespace
Character case Differences in character case are significant
Line endings Differences in line endings (CR and LF characters) are ignored
CR/LF characters Not shown in the comparison detail

301.4 Active regular expressions

No regular expressions were active.

301.5 Comparison detail

  1   /********* ********** ********** ********** ********** ********** *********
  2    * Copyrii ght 2008 V HA. All ri ghts reser ved
  3    ********* ********** ********** ********** ********** ********** *********/
  4   package go v.va.med.f w.service. ldap;
  5  
  6   import jav a.util.Arr ayList;
  7   import jav a.util.Col lection;
  8   import jav a.util.Lis t;
  9  
  10   import org .springfra mework.bea ns.factory .annotatio n.Autowire d;
  11   import org .springfra mework.lda p.core.Dir ContextOpe rations;
  12   import org .springfra mework.sec urity.core .GrantedAu thority;
  13   import org .springfra mework.sec urity.core .authority .SimpleGra ntedAuthor ity;
  14   import org .springfra mework.ste reotype.Se rvice;
  15  
  16   import gov .va.med.fw .model.lda p.LdapPers on;
  17   import gov .va.med.fw .model.lda p.SearchCr iteria;
  18   import gov .va.med.fw .persisten t.ldap.Lda pGroupDao;
  19   import gov .va.med.fw .persisten t.ldap.Lda pPersonDao ;
  20  
  21   /**
  22    * Service  Implement ation for  LdapPerson .
  23    * 
  24    * CISS ci ss_framewo rk Jun 23,  2008
  25    * 
  26    * @author  
D NS
  27    */
  28   @Service
  29   public cla ss LdapPer sonService Impl imple ments Ldap PersonServ ice {
  30           
  31           @A utowired
  32           pr ivate Ldap PersonDao  personDao;
  33           @A utowired
  34           pr ivate Ldap GroupDao g roupDao;
  35  
  36           pu blic LdapP erson find ByDistingu ishedName( String dn)  {
  37                    retu rn personD ao.findByD istinguish edName(dn) ;
  38           }
  39  
  40           pu blic List  findAll()  {
  41                    retu rn personD ao.findAll ();
  42           }
  43  
  44           pu blic List  find(Searc hCriteria  criteria)  {
  45                    retu rn personD ao.find(cr iteria);
  46           }
  47  
  48           pu blic LdapP erson find BySamAccou ntName(Str ing sAMAcc ountName)  {
  49                    retu rn personD ao.findByS amAccountN ame(sAMAcc ountName);
  50           }
  51  
  52           pu blic void  setPersonD ao(LdapPer sonDao per sonDao) {
  53                    this .personDao  = personD ao;
  54           }
  55  
  56           pu blic void  setGroupDa o(LdapGrou pDao group Dao) {
  57                    this .groupDao  = groupDao ;
  58           }
  59  
  60           pu blic boole an authent icate(Stri ng userDn,  String pa ssword) {
  61                    retu rn personD ao.authent icate(user Dn, passwo rd);
  62           }
  63  
  64           /* *
  65            *  The updat eGroups me thod adds  and remove s an ldapP erson from  specified
  66            *  ldapGroup s by modif ying the m embers att ribute of  each group . Note tha t a
  67            *  group's C N must be  the same a s it's sAM AccountNam e.
  68            *  
  69            *  @param ld apPerson
  70            *              The ldap Person to  be removed  or added  to LdapGro ups.
  71            * /
  72   //      pu blic void  updateGrou ps(LdapPer son ldapPe rson) {
  73   //               // D elete pers on from gr oups
  74   //               for  (Iterator  i = ldapPe rson.getDe letedGroup s().iterat or(); i.ha sNext();)  {
  75   //                        String  cnToRemov e = (Strin g) i.next( );
  76   //                        LdapGr oup groupT oDelete =  groupDao.f indByDisti nguishedNa me(cnToRem ove);
  77   //                        groupT oDelete.ge tMembers() .remove(ld apPerson.g etDn());
  78   //                        groupD ao.update( groupToDel ete);
  79   //               }
  80   //
  81   //               // A dd person  to groups
  82   //               for  (Iterator  i = ldapPe rson.getNe wGroups(). iterator() ; i.hasNex t();) {
  83   //                        String  cnToAdd =  (String)  i.next();
  84   //                        LdapGr oup groupT oAdd = gro upDao.find ByDistingu ishedName( cnToAdd);
  85   //                        groupT oAdd.getMe mbers().ad d(ldapPers on.getDn() );
  86   //                        groupD ao.update( groupToAdd );
  87   //               }
  88   //      }
  89  
  90           /*
  91            *  (non-Java doc)
  92            *  
  93            *  @seeorg.s pringframe work.secur ity.ldap.L dapAuthori tiesPopula tor#
  94            *  getGrante dAuthoriti es(org.spr ingframewo rk.ldap.co re.DirCont extOperati ons,
  95            *  java.lang .String)
  96            * /
  97           pu blic Colle ction<Gran tedAuthori ty> getGra ntedAuthor ities(DirC ontextOper ations use r, String  username)  {
  98                    Ldap Person lda pPerson =  findBySamA ccountName (username) ;
  99                    // c onvert rol es to Gran ted Author ities
  100                    if ( ldapPerson  != null & & ldapPers on.getGrou ps() != nu ll) {
  101                             Collec tion<Grant edAuthorit y> roles =  new Array List<Grant edAuthorit y>();
  102                             int lo cation = 0 ;
  103                             for (O bject role  : ldapPer son.getGro ups()) {
  104                                      GrantedA uthority a uthority =  new Simpl eGrantedAu thority((S tring) rol e);
  105                                      roles.ad d(authorit y);
  106                             }
  107                             return  roles;
  108                    }
  109  
  110                    retu rn new Arr ayList<Gra ntedAuthor ity>();
  111           }
  112   }