@ Exported ( name = "usage" ) public @ Nonnull List < RangeItem > _getUsages ( ) { List < RangeItem > r = new ArrayList <> ( ) ; final Jenkins instance = Jenkins . getInstance ( ) ; for ( Entry < String , RangeSet > e : usages . entrySet ( ) ) { final String itemName = e . getKey ( ) ; if ( instance . hasPermission ( Jenkins . ADMINISTER ) || canDiscoverItem ( itemName ) ) { r . add ( new RangeItem ( itemName , e . getValue ( ) ) ) ; } } return r ; }
this is for remote API