title: Laravel Backpack::crud set permission (role) to a category
body: <p>I'm trying to set Role (or permission) to my category in Laravel Backpack (newscrud).
  I have added the field of Role in CategoryCrudController class and category_role table in DB and set relations in Category and Role models.
  the relation data is now stored in the table, although the checkbox remains unchecked!</p>
  
  <pre><code>$this-&gt;crud-&gt;addField(
          [
              'label' =&gt; 'Roles',
              'type' =&gt; 'checklist',
              'name' =&gt; 'roles',
              'entity' =&gt; 'roles',
              'attribute' =&gt; 'name',
              'model' =&gt; "Backpack\PermissionManager\app\Models\Role",
              'pivot' =&gt; true,
          ]
      );
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/GcDJf.jpg" rel="nofollow noreferrer">Added role field</a></p>
  
  <p>Now I want to allow the users with the granted role to use crud on the category's articles.
  I know I can use hasRole and use denyAccess() in CrudController's setup function but it doesn't what I want.</p>
  
  <pre><code>public function setup(){
     if (backpack_user()-&gt;hasRole('certainCategoryRole')) {
       $this-&gt;crud-&gt;denyAccess([ 'delete','edit','write']);
     }
  }
  </code></pre>
  
  <p>I need to give articles operations access to users by their category's assigned role.</p>
  
  <p>Can anyone help?</p>
  
  <p>Thanx</p>