0

I added a new attribute to product table using EAV method, this attribute is to save the ID of the user who's add the product.

So, I need to add a new column to product grid on BackOffice but with permission, that means this column will be visible just to admins and not for other admin user roles.

I try to do it, by adding a new XML file :

<?xml version="1.0" encoding="utf-8"?> 
<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
      <columns name="product_columns">
            <column name="user_name" component="Magento_Ui/js/grid/columns/select" sortOrder="76">
                  <settings>
                        <addField>true</addField>
                        <options class="Magento\Config\Model\Config\Source\Yesno"/>
                        <filter>text</filter>
                        <dataType>text</dataType>
                        <sortable>false</sortable>
                        <label translate="true">Name of user</label>
                  </settings>
            </column>
      </columns>
</listing>

but after that, I crashed, and I don't know how to make relation with the data and adding the permission, I try to do what I see on a lot of tutorials but without any result, is there any solution?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.