I need to do API method, which return data from db table just for admin. There is my method:
/**
* @return array
* @throws \Magento\Framework\Exception\LocalizedException
*/
public function showAddedSku()
{
$insSku = $this->collection->create();
$data = [];
foreach ($insSku as $key => $sku)
{
$data[$key]['id'] = $sku->getId();
$data[$key]['sku'] = $sku->getSku();
$data[$key]['count'] = $sku->getCount();
}
return $data;
}
How can I check, that it is admin?
I read, that I must set that:
<resources>
<resource ref="???" />
</resources>
but what ref should i choose?