controls(user, context) {
    const items = new ItemList();

    ['user', 'moderation', 'destructive'].forEach(section => {
      const controls = this[section + 'Controls'](user, context).toArray();
      if (controls.length) {
        controls.forEach(item => items.add(item.itemName, item));
        items.add(section + 'Separator', Separator.component());
      }
    });

    return items;
  }
/**
   * Get a list of controls for a user.
   *
   * @param {User} user
   * @param {*} context The parent component under which the controls menu will
   *     be displayed.
   * @return {ItemList}
   * @public
   */
Get a list of controls for a user.
@param {User} user
@param {*} context The parent component under which the controls menu will
be displayed.
Get a list of controls for a user . @param { User } user @param { * } context The parent component under which the controls menu will be displayed .
controls(user, context) {
    const items = new ItemList();
    ['user', 'moderation', 'destructive'].forEach(section => {
      const controls = this[section + 'Controls'](user, context).toArray();
      if (controls.length) {
        controls.forEach(item => items.add(item.itemName, item));
        items.add(section + 'Separator', Separator.component());
      }
    });
    return items;
  }
controls ( user , context ) { const items = new ItemList ( ) ; [ 'user' , 'moderation' , 'destructive' ] . forEach ( section => { const controls = this [ section + 'Controls' ] ( user , context ) . toArray ( ) ; if ( controls . length ) { controls . forEach ( item => items . add ( item . itemName , item ) ) ; items . add ( section + 'Separator' , Separator . component ( ) ) ; } } ) ; return items ; }
Get a list of controls for a user.
Get a list of controls for a user .