@@ -623,6 +623,7 @@ private bool CheckAnyUserRoles(string roles)
623623 if ( ! string . IsNullOrEmpty ( Item ) ) {
624624 if ( PortalSecurity . IsInRole ( Item ) ) {
625625 found = true ;
626+ continue ;
626627 }
627628 }
628629 }
@@ -654,20 +655,25 @@ private ArrayList RecalcCategoryCount(ArrayList categories)
654655 ArrayList repositoryItems = repository . GetRepositoryObjects ( m_RepositoryId , "" , "Downloads" , 1 , - 1 , "" , - 1 ) ;
655656 ArrayList bindableList = new ArrayList ( ) ;
656657 LoadBindableList ( bIsPersonal , repositoryItems , bindableList ) ;
657-
658- // recalc the category counts
659- foreach ( RepositoryCategoryInfo category in categories ) {
660- foreach ( RepositoryInfo item in bindableList ) {
661- ArrayList cats = rc . GetRepositoryObjectCategories ( item . ItemId ) ;
662- foreach ( RepositoryObjectCategoriesInfo _cat in cats ) {
663- if ( _cat . CategoryID == category . ItemId ) {
664- category . Count = category . Count + 1 ;
665- }
666- }
667- }
668- }
669-
670- return categories ;
658+
659+ // recalc the category counts
660+ foreach ( RepositoryInfo item in bindableList )
661+ {
662+ ArrayList cats = rc . GetRepositoryObjectCategories ( item . ItemId ) ;
663+ foreach ( RepositoryObjectCategoriesInfo _cat in cats )
664+ {
665+ foreach ( RepositoryCategoryInfo category in categories )
666+ {
667+ if ( _cat . CategoryID == category . ItemId )
668+ {
669+ category . Count = category . Count + 1 ;
670+ }
671+ }
672+ }
673+ }
674+
675+
676+ return categories ;
671677
672678 }
673679
@@ -761,10 +767,12 @@ private void BindData()
761767 }
762768
763769 private void LoadBindableList ( bool bIsPersonal , ArrayList repositoryItems , ArrayList bindableList )
764- {
765- if ( bIsPersonal ) {
766- foreach ( RepositoryInfo dataitem in repositoryItems ) {
767- if ( int . Parse ( dataitem . CreatedByUser ) == UserId | PortalSecurity . IsInRole ( "Administrators" ) ) {
770+ {
771+ if ( bIsPersonal )
772+ {
773+ bool isAdministrator = PortalSecurity . IsInRole ( "Administrators" ) ;
774+ foreach ( RepositoryInfo dataitem in repositoryItems ) {
775+ if ( int . Parse ( dataitem . CreatedByUser ) == UserId | isAdministrator ) {
768776 bindableList . Add ( dataitem ) ;
769777 }
770778 }
0 commit comments